| set_read {bioset} | R Documentation |
Read a matrix of values from a csv sheet and sort them into a tibble. You
can name the values and encode several additional properties into the name,
which be split into several columns. Please refer to the vignette
(browseVignettes("roxygen2")) and examples below for in-depth explanation
and the whys and hows.
set_read(file_name = "set_#NUM#.csv", path = ".", num = 1, sep = ",", dec = ".", cols = 0, rows = 0, additional_vars = vector(), additional_sep = "[^[:alnum:]]+")
file_name |
Name of the file from which to read the data. May contain "#NUM#" as a placeholder if you have multiple files. |
path |
The path to the file (no trailing "/" or "\" !). |
num |
Number of the set to read, inserted for "#NUM#". |
sep |
Separator used in the csv-file, either "," or ";" (see
|
dec |
The character used for decimal points (see |
cols |
Number of columns in the input matrix ( |
rows |
Number of rows containing values (not names / additional data)
in the input matrix ( |
additional_vars |
Vector of strings containing the names for the additional columns. |
additional_sep |
String / RegExp that separates additional vars, e.g.:
|
A tibble containing (at minimum) set, position, sample_id,
name and value.
Other set functions: set_calc_concentrations,
set_calc_variability,
sets_read
# a file containing only values
read.csv(
file = system.file("extdata", "values.csv", package = "bioset"),
header = FALSE,
colClasses = "character"
)
# read into a tibble
set_read(
file_name = "values_names.csv",
path = system.file("extdata", package = "bioset"),
)
# file containing names
read.csv(
file = system.file("extdata", "values_names.csv", package = "bioset"),
header = FALSE,
colClasses = "character"
)
# read a file containing labels and store those in column "name"
set_read(
file_name = "values_names.csv",
path = system.file("extdata", package = "bioset"),
additional_vars = c("name")
)
# file with names and properties
read.csv(
file = system.file(
"extdata", "values_names_properties.csv", package = "bioset"),
header = FALSE,
colClasses = "character"
)
# read a file containing labels and properties and store those in columns
# "name" and "time"
# splits names by every character that's not A-Z, a-z, 0-9
# to change that behaviour use additional_sep
set_read(
file_name = "values_names_properties.csv",
path = system.file("extdata", package = "bioset"),
additional_vars = c("name", "time")
)
# read file "set_1.csv" containing labels
set_read(
num = 1,
path = system.file("extdata", package = "bioset"),
additional_vars = c("name", "time")
)
# read file "set_2.csv" containing labels
set_read(
num = 2,
path = system.file("extdata", package = "bioset"),
additional_vars = c("name", "time")
)
# read file "plate_2.csv" containing labels
set_read(
num = 2,
file_name = "plate_#NUM#.csv",
path = system.file("extdata", package = "bioset"),
additional_vars = c("name", "time")
)