Given a string of delimited file data, this function will parse the file as a table of data an apply some transformations and augmentations as specified by a given configuration list.
generic_parseData(fileString = NULL, configList = NULL)
fileString | Character string of delimited data to parse. |
---|---|
configList | A |
A tibble of the data contined in fileString
parsed according
to parameters in configList
. The data is coerced into a format that
is more easily convertable into a ws_monitor
object at a later
point.
Internally, this function uses read_delim
to convert
fileString
into a tibble. If any lines of data cannot be properly
parsed, and error will be thrown anf the problem lines will be printed.
For more information on how to build a configList
, see the Rmarkdown
document "Working with Generic Data" in the localNotebooks
directory.
filePath <- system.file( "extdata", "generic_data_example.csv", package = "PWFSLSmoke", mustWork = TRUE ) configPath <- system.file( "extdata", "generic_configList_example.json", package = "PWFSLSmoke", mustWork = TRUE ) configList <- jsonlite::fromJSON(configPath) fileString <- generic_downloadData(filePath)#> INFO [2021-11-19 10:17:41] Reading file from location: #> /private/var/folders/84/y311lppx4519st7n8_gfkd1w0000gn/T/RtmpQZWbh3/temp_libpath95c8341a1006/PWFSLSmoke/extdata/generic_data_example.csv #> INFO [2021-11-19 10:17:41] Reading file from location: #> /private/var/folders/84/y311lppx4519st7n8_gfkd1w0000gn/T/RtmpQZWbh3/temp_libpath95c8341a1006/PWFSLSmoke/extdata/generic_data_example.csv #> INFO [2021-11-19 10:17:41] Reading file from location: #> /private/var/folders/84/y311lppx4519st7n8_gfkd1w0000gn/T/RtmpQZWbh3/temp_libpath95c8341a1006/PWFSLSmoke/extdata/generic_data_example.csv #> INFO [2021-11-19 10:17:41] Reading file from location: #> /private/var/folders/84/y311lppx4519st7n8_gfkd1w0000gn/T/RtmpQZWbh3/temp_libpath95c8341a1006/PWFSLSmoke/extdata/generic_data_example.csvparsedData <- generic_parseData(fileString, configList)