| utils | R Documentation |
A collection of simple functions to quickly access the
TargetSearchData data files. These functions are used throughout
TargetSearch examples. See details for an
explanation of each function.
tsd_path()
tsd_data_path(datapath='gc-ms-data')
tsd_file_path(filename, ...)
tsd_cdffiles(...)
tsd_rifiles(...)
datapath |
A |
filename |
A |
... |
parameters passed to |
tsd_path() returns the path of TargetSearchData. It is
a shorthand for find.package('TargetSearchData').
tsd_data_path() returns the full path of the directory where the
CDFs and other example files of TargetSearch
are located. This path is hard-coded to 'gc-ms-data'. The path can be
changed by setting the data path parameter datapath, though this is
unnecessary in general.
tsd_file_path() returns the absolute path of one or more files
(filename) inside the data directory (datapath). The function
checks whether the file exist and fails if not. The name of the first
missing file is printed.
tsd_cdffiles() and tsd_rifiles() are convenience functions that
return the list of NetCDF files and RI files contained in the data path,
respectively.
All functions return a character vector. They are paths to files or directories
within TargetSearchData. The functions tsd_cdffiles and
tsd_rifiles return a list of files.
Alvaro Cuadros-Inostroza
The package TargetSearch
# get TargetSearchData path
path <- tsd_path()
# get TargetSearchData data path
path <- tsd_data_path()
# get the path to the files "samples.txt" in TargetSearchData
path <- tsd_file_path('samples.txt')
# get the list of CDF files
cdffiles <- tsd_cdffiles()
# get the list of RI files
rifiles <- tsd_rifiles()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.