This function reads a spreadsheet (from a Google sheet URL or a local file in .xlsx, .csv, or .sav format) and imports the DCT specifications in it.

dct_from_spreadsheet(
  x,
  path = NULL,
  sheet = NULL,
  localBackup = NULL,
  exportGoogleSheet = TRUE,
  xlsxPkg = c("rw_xl", "openxlsx", "XLConnect"),
  preventOverwriting = psyverse::opts$get("preventOverwriting"),
  encoding = psyverse::opts$get("encoding"),
  silent = psyverse::opts$get("silent")
)

Arguments

x

The URL or path to a file.

path

The path to save the DCT specifications.

sheet

Optionally, the name(s) of the worksheet(s) to select.

localBackup

If not NULL, a valid filename to write a local backup to.

exportGoogleSheet

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.

xlsxPkg

Which package to use to work with Excel spreadsheets.

preventOverwriting

Whether to prevent overwriting.

encoding

The encoding to use.

silent

Whether to be silent or chatty.

Value

Invisibly, an object with the worksheets and the DCT objects.