import_adjustment | R Documentation |
Adjust device imports or make your own
import_adjustment(import_expr)
import_expr |
A named list of import expressions. The basis for
|
This function should only be used with some knowledge of how
expressions work in R. The minimal required output for an expression to work
as expected, it must lead to a data frame containing a Datetime
column with
the correct time zone. It has access to all arguments defined in the
description of import_Dataset()
. The ...
argument should be passed to
whatever csv reader function is used, so that it works as expected. Look at
ll_import_expr()$LYS
for a quite minimal example.
A list of import functions
#create a new import function for the LYS device, same as the old
new_import <- import_adjustment(ll_import_expr())
#the new one is identical to the old one in terms of the function body
identical(body(import$LYS), body(new_import$LYS))
#change the import expression for the LYS device to add a message at the top
new_import_expr <- ll_import_expr()
new_import_expr$LYS[[4]] <-
rlang::expr({ cat("**This is a new import function**\n")
data
})
new_import <- import_adjustment(new_import_expr)
filepath <- system.file("extdata/sample_data_LYS.csv", package = "LightLogR")
#Now, a message is printed when the import function is called
new_import <- new_import$LYS(filepath)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.