import_ext: Import an object

Description Usage Arguments Details Value

View source: R/import.R

Description

Reads in data given a file, directory, and extension, or a full path directly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19

Arguments

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 file, dir, and ext,

...

dots. Arguments to pass dircetly to internally used import function.

import

logical. Indicates whether to actually execute function.

return

logical. Relevant ONLY if export == FALSE. Set to TRUE in order to preview what would be rendered.

Details

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').

Value

object.


tonyelhabr/teproj documentation built on June 21, 2020, 12:56 p.m.