read_wides {gcplyr} | R Documentation |
Read wides
Description
A function that imports widemeasures in files into the R environment
Usage
read_wides(
files,
filetype = NULL,
startrow = NULL,
endrow = NULL,
startcol = NULL,
endcol = NULL,
header = TRUE,
sheet = NULL,
run_names = NULL,
run_names_header = "file",
run_names_dot = FALSE,
run_names_path = TRUE,
run_names_ext = FALSE,
metadata = NULL,
na.strings = c("NA", ""),
extension,
names_to_col,
...
)
Arguments
files |
A vector of filepaths (relative to current working directory) where each one is a widemeasures set of data |
filetype |
(optional) the type(s) of the files. Options include: "csv", "xls", or "xlsx". "tbl" or "table" to use read.table to read the file, "csv2" to use read.csv2, "delim" to use read.delim, or "delim2" to use read.delim2. If none provided, |
startrow , endrow , startcol , endcol |
(optional) the rows and columns where
the data are located in Can be a vector or list the same length as If not provided, data is presumed to begin on the first row and column of the file(s) and end on the last row and column of the file(s). |
header |
logical for whether there is a header in the data. If FALSE
columns are simply numbered. If TRUE, the first row of the
data ( |
sheet |
The sheet of the input files where data is located (if input files are .xls or .xlsx). If not specified defaults to the first sheet |
run_names |
Names to give the widemeasures read in. By default uses the file names if not specified |
run_names_header |
Should the run names (provided in |
run_names_dot |
If run_names are inferred from filenames, should the leading './' (if any) be retained |
run_names_path |
If run_names are inferred from filenames, should the path (if any) be retained |
run_names_ext |
If run_names are inferred from filenames, should the file extension (if any) be retained |
metadata |
(optional) non-spectrophotometric data that should be associated with each read widemeasures. A named list where each item in the list is either: a vector of length 2, or a list containing two vectors. In the former case, each vector should provide the row and column where the metadata is located in all of the blockmeasures input files. In the latter case, the first vector should provide the rows where the metadata is located in each of the corresponding input files, and the second vector should provide the columns where the metadata is located in each of the corresponding input files. (This case is typically used when reading multiple blocks from a single file.) |
na.strings |
A character vector of strings which are to be interpreted
as |
extension |
Deprecated, use |
names_to_col |
Deprecated, use |
... |
Other arguments passed to read.csv, read_xls, read_xlsx, or read.table |
Details
startrow, endrow, startcol, endcol, timecol, sheet and filetype
can either be a single value that applies for all files or
vectors or lists the same length as files
,
Value
A dataframe containing a single widemeasures, or A list of widemeasures named by filename