import2 {W4MRUtils}R Documentation

Import two W4M tables

Description

import2 Function to import a metadata table file and its corresponding dataMatrix file. import2 performs checks to ensure the identifiers match between the two tables and stops with an explicit error message in case identifiers do not match.

Usage

import2(pathDM, pathMeta, typeMeta, disable_comm = TRUE)

Arguments

pathDM

a path to a file corresponding to the dataMatrix

pathMeta

a path to a file corresponding to the metadata table

typeMeta

"sample" or "variable" depending on the metadata content

disable_comm

a boolean with default to TRUE to indicate whether the comment character # should be disabled as a comment tag for the import of the metadata file; when TRUE, # in the metadata table's columns will be considered as any other character.

Value

a list containing two elements:

Author(s)

M.Petera

Examples



dm_path <- system.file(
  "extdata",
  "mini_datamatrix.txt",
  package="W4MRUtils"
)
meta_path <- system.file(
  "extdata",
  "mini_variablemetadata.txt",
  package="W4MRUtils"
)

## import considering # is not a comment character
A <- W4MRUtils::import2(dm_path, meta_path, "variable")
print(A$dataMatrix[1:5, 1:5])
print(A$metadata[1:5, ])

## import considering # is a comment character
B <- W4MRUtils::import2(dm_path, meta_path, "variable", disable_comm = FALSE)
print(B$dataMatrix[1:5, 1:5])
print(B$metadata[1:5, ])



[Package W4MRUtils version 1.0.0 Index]