Description Usage Arguments Details Value
Reads in data given a file, directory, and extension, or a full path directly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import_ext(
file,
dir = getwd(),
ext,
path = file.path(dir, paste0(file, ".", ext)),
...,
import = TRUE,
return = TRUE
)
import_ext_csv(...)
import_ext_xlsx(...)
import_ext_rdata(...)
import_ext_rda(...)
import_ext_rds(...)
|
file |
character. Bare file (i.e. without folderor extension), |
dir |
character. Folder name (with a trailing slash). |
ext |
character. Bare extension (i.e. without a dot). Must be one of valid formats. |
path |
character. Concatenation of |
... |
dots. Arguments to pass dircetly to internally used import function. |
import |
logical. Indicates whether to actually execute function. |
return |
logical. Relevant ONLY if |
This function is intended to be a direct counterpart to the similarly
named export function. It should be used in a NSE manner. However, this may not be what the user wants.
(The NSE aspect is perhaps more appropriate for exporting, where choices about file name
may be determined from the object name.)
import_path()
may be a suitable alternative.
Note that the user may not typically be concerned with the import
and
return
parameters. Nonetheless, these are provided in order to facilitate usage
with scripts run using "meta"-parameters that determine what data to import.
Internally, a distinct method (session::restore.session
)
is used for the RData-type file extension in order
to allow for importing of packages.
Many supplementary functions, using the format import_ext_*()
are provided
for convenience. (e.g. import_ext_csv()
instead of import_ext(..., ext = 'csv').
object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.