#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
ll_import_expr$LYS[[4]] <-
rlang::expr({ cat("**This is a new import function**\n")
data
})
new_import <- import_adjustment(ll_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)
Run the code above in your browser using DataLab