import3 {W4MRUtils} | R Documentation |
Import the three W4M tables
Description
import3 Function to import the three W4M tables from files (dataMatrix, sampleMetadata, variableMetadata) import3 performs checks to ensure the identifiers match between the three tables and stops with an explicit error message in case identifiers do not match.
Usage
import3(pathDM, pathSM, pathVM, disable_comm = TRUE)
Arguments
pathDM |
a path to a file corresponding to the dataMatrix |
pathSM |
a path to a file corresponding to the sampleMetadata |
pathVM |
a path to a file corresponding to the variableMetadata |
disable_comm |
a |
Value
a list
containing three elements:
dataMatrix a
data.frame
corresponding to the imported dataMatrix table;sampleMetadata a
data.frame
corresponding to the imported sampleMetadata table;variableMetadata a
data.frame
corresponding to the imported variableMetadata table
Author(s)
M.Petera
Examples
dm_path <- system.file(
"extdata",
"mini_datamatrix.txt",
package="W4MRUtils"
)
vm_path <- system.file(
"extdata",
"mini_variablemetadata.txt",
package="W4MRUtils"
)
sm_path <- system.file(
"extdata",
"mini_samplemetadata.txt",
package="W4MRUtils"
)
## import considering # is not a comment character
A <- W4MRUtils::import3(dm_path, sm_path, vm_path)
print(A$dataMatrix[1:5, 1:5])
print(A$sampleMetadata[1:5, ])
print(A$variableMetadata[1:5, ])
## import considering # is a comment character
B <- W4MRUtils::import3(dm_path, sm_path, vm_path, disable_comm = FALSE)
print(B$dataMatrix[1:5, 1:5])
print(B$sampleMetadata[1:5, ])
print(B$variableMetadata[1:5, ])