Convenience function to read spreadsheet-like files
read_spreadsheet.RdCurrently reads spreadsheets from Google Sheets or from xlsx, csv,
or sav files.
Arguments
- x
The URL or path to a file.
- sheet
Optionally, the name(s) of the worksheet(s) to select.
- columnDictionary
Optionally, a dictionary with column names to check for presence. A named list of vectors.
- localBackup
If not
NULL, a valid filename to write a local backup to.- exportGoogleSheet
If
xis a URL to a Google Sheet, instead of using thegooglesheets4package to download the data, by passingexportGoogleSheet=TRUE, an export link will be produced and the data will be downloaded as Excel spreadsheet.- flattenSingleDf
Whether to return the result as a data frame if only one data frame is returned as a result.
- xlsxPkg
Which package to use to work with Excel spreadsheets.
- failQuietly
Whether to give an error when
xis not a valid URL or existing file, or just returnNULLinvisibly.- silent
Whether to be silent or chatty.
Value
A list of dataframes, or, if only one data frame was loaded and
flattenSingleDf is TRUE, a data frame.
Examples
### This requires an internet connection!
if (FALSE) { # \dontrun{
read_spreadsheet(
paste0(
"https://docs.google.com/",
"spreadsheets/d/",
"1bHDzpCu4CwEa5_3_q_9vH2691XPhCS3e4Aj_HLhw_U8"
)
);
} # }