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)

Arguments

fileString

Character string of delimited data to parse.

configList

A R list or JSON file containing key-value pairs which affect how the parsing of fileString is handled. If configList is in JSON format, it can be passed in as a file, string, or URL.

Value

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.

Parsing data

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.

Creating a configList

For more information on how to build a configList, see the Rmarkdown document "Working with Generic Data" in the localNotebooks directory.

Examples

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.csv
parsedData <- generic_parseData(fileString, configList)