readOSF: Read data from the Open Science Framework

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function first calls getOSFfile to download a file from the OSF to a temporary location and then calls an appropriate function to read the data into R (see details).

Usage

1
readOSF(code, readfun, ...)

Arguments

code

A string indicating either the file link ("https://osf.io/XXXXX/") or just the code (in this case "XXXXX")

readfun

The function to use when reading the data. If omitted the function will choose one based on the filetype of the file (see details).

...

Arguments sent to the read function.

Details

Depending on the file type by default the following readfunction is chosen:

xlsx

read.xlsx

xls

read.xls

sav

read.spss

csv

read.csv

txt

read.table

dta

read.dta

Look at the help page of each read function to obtain more information about the arguments needed.

Value

The result of the read function; typically a data frame.

Author(s)

Sacha Epskamp <mail@sachaepskamp.com>

See Also

getOSFfile

Examples

1
2
3
4
5
6
## Not run: 
# Read the Replication Project Psychology master data (https://osf.io/5wup8/):
RPPmaster <- readOSF("5wup8", sheetName = "MASTER", startRow = 5, header = TRUE, 
                      stringsAsFactors = FALSE) 
        
## End(Not run)

SachaEpskamp/OSF2R documentation built on May 9, 2019, 12:07 p.m.