Currently reads spreadsheets from Google Sheets or from xlsx
, csv
,
or sav
files.
read_spreadsheet(
x,
sheet = NULL,
columnDictionary = NULL,
localBackup = NULL,
exportGoogleSheet = FALSE,
flattenSingleDf = FALSE,
xlsxPkg = c("rw_xl", "openxlsx", "XLConnect"),
failQuietly = FALSE,
silent = rock::opts$get("silent")
)
A list of dataframes, or, if only one data frame was loaded and
flattenSingleDf
is TRUE
, a data frame.
The URL or path to a file.
Optionally, the name(s) of the worksheet(s) to select.
Optionally, a dictionary with column names to check for presence. A named list of vectors.
If not NULL
, a valid filename to write a local
backup to.
If x
is a URL to a Google Sheet, instead of using
the googlesheets4
package to download the data, by passing
exportGoogleSheet=TRUE
, an export link will be produced and the data
will be downloaded as Excel spreadsheet.
Whether to return the result as a data frame if only one data frame is returned as a result.
Which package to use to work with Excel spreadsheets.
Whether to give an error when x
is not a valid URL
or existing file, or just return NULL
invisibly.
Whether to be silent or chatty.
### This requires an internet connection!
if (FALSE) {
read_spreadsheet(
paste0(
"https://docs.google.com/",
"spreadsheets/d/",
"1bHDzpCu4CwEa5_3_q_9vH2691XPhCS3e4Aj_HLhw_U8"
)
);
}
Run the code above in your browser using DataLab