load_from_sas | R Documentation |
load_from_sas
will load data tables from SAS to R; various library connections and pre-processing code can be
included prior to data loading to allow SAS to conduct formatting and calculations on its side. Tables are temporarily extracted
to the default R installation location, if there are no errors, the table will be deleted from this location upon loading into memory for R.
The SAS script and log will have a random number attached to ensure multiple users dont clash onto the same file.
Requires a local version of SAS 9.4 which must be accessible from the RStudio instance.
load_from_sas(
datalist,
sas_path = "C:/Program Files/SASHome/SASFoundation/9.4/sas.exe",
config_file = NULL,
add_library = "",
add_code = "",
convert2csv = FALSE,
keep_attr = FALSE
)
datalist |
A string vector of library and tables names in SAS (libname.tablename). |
sas_path |
File path to SAS 9.4 executable; default set to a rough standard of: |
config_file |
File path for SAS 9.4 configuration file (e.g. C:/.../SAS9.4_Prod/SASV9.CFG) |
add_library |
Character string (SAS code) for additional libraries to be mapped (see |
add_code |
Character string (SAS code) for additional data formatting and calculations to perform before loading data. |
convert2csv |
Logical variable (TRUE/FALSE) to indicate if the data exported from SAS should be in csv format. |
keep_attr |
Logical variable (TRUE/FALSE) to indicate if attribute values should be stripped from the output tables upon loading from SAS. |
Dataset(s) based upon the input parameters.
## Not run:
load_from_sas(c('LIBNAME1.TBLNAME1', 'LIBNAME2.TBLNAME1'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.