| read_blocks | R Documentation |
A function that reads blocks into the R environment
read_blocks(
files,
filetype = NULL,
startrow = NULL,
endrow = NULL,
startcol = NULL,
endcol = NULL,
sheet = NULL,
metadata = NULL,
block_names = NULL,
block_names_header = "block_name",
block_names_dot = FALSE,
block_names_path = TRUE,
block_names_ext = FALSE,
header = NA,
sider = NA,
wellnames_numeric = FALSE,
na.strings = c("NA", ""),
extension,
block_name_header,
...
)
files |
A |
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 measures data are located in Can be a 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). |
sheet |
(optional) If data is in .xls or .xlsx files, which sheet it is located on. Defaults to the first sheet if not specified |
metadata |
(optional) non-density data that should be
associated with each read blockmeasures. A named In the former case, each In the latter case, the first |
block_names |
(optional) |
block_names_header |
The name of the metadata field containing the
|
block_names_dot |
If |
block_names_path |
If |
block_names_ext |
If |
header |
|
sider |
|
wellnames_numeric |
If row names and column names are not provided in the
input If If |
na.strings |
A |
extension |
Deprecated, use |
block_name_header |
Deprecated, use |
... |
Other arguments passed to read.csv, read_xls, read_xlsx, or read.table |
For metadata, read_blocks can handle an arbitrary number of additional
pieces of information to extract from each blockcurve file as metadata.
These pieces of information are specified as a named list of vectors
where each vector is the c(row, column) where the information is to be
pulled from in the input files.
This metadata is returned as the second list element of each
blockcurve, e.g.:
[[1]]
[1] data #1
[2] metadata
[2][1] name #1
[2][2] date-time #1
[2][3] temp #1
[[2]]
[1] data #2
[2] metadata
[2][1] name #2
[2][2] date-time #2
[2][3] temp #2
...
Calling uninterleave on the output of read_blocks works on block data
and the associated metadata because uninterleave operates on the highest
level entries of the list (the [[1]] [[2]] level items),
leaving the meta-data associated with the block data
trans_block_to_wide integrates this metadata into the
wide-shaped data.frame it produces
A list where each entry is a list containing the block data.frame
followed by the block_names (or filenames, if block_names is not
provided) and any specified metadata.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.