importSample: Sample importation

Description Usage Arguments Details Value See Also Examples

View source: R/sampleBuilding.R

Description

Import the required and the optional files, and build a dataset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
importSample(
  file.features = "",
  file.meta = "",
  file.profiles = "",
  file.RDS = "",
  file.config = "",
  dir.images = "",
  dir.save = ".",
  sepFeat = ",",
  decFeat = ".",
  naFeat = c("", "NA"),
  sepSig = ",",
  decSig = ".",
  naSig = c("", "NA"),
  headerCSV = TRUE,
  RclusTool.env = new.env(),
  save.to.disk = TRUE,
  ...
)

Arguments

file.features

character vector specifying the csv file containing features data.

file.meta

character vector specifying the txt file containing metadata.

file.profiles

character vector specifying the csv file containing profiles data.

file.RDS

character vector for a RDS file containing a data.sample object. This file is automatically saved when importing a (csv-)file-features. When both a csv-file-features and a RDS file are given, the last one is ignored.

file.config

character vector for the name of the configuration file.

dir.images

character vector containing the path of images directory.

dir.save

character vector specifying path of the working directory.

sepFeat

character specifying the field separator for the csv file containing features data.

decFeat

character specifying the decimal points for the csv file containing features data.

naFeat

vector containing missing values for the csv file containing features data.

sepSig

character specifying the field separator for the csv file containing profiles data.

decSig

character specifying the decimal point for the csv file containing profiles data.

naSig

vector containing missing values for the csv file containing profiles data.

headerCSV

boolean if TRUE (default) the file contains the names of the variables as its first line.

RclusTool.env

environment in which data and intermediate results are stored.

save.to.disk

boolean if TRUE (default) some data files and folders are saved to disk.

...

parameters adressed to read.csv functions.

Details

function to import sample from CSV files; sample is preprocessed

Value

data.sample loaded data.sample.

See Also

loadSample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf1 <- tempfile()
write.table(dat, tf1, sep=",", dec=".")

metadat <- rbind("First metadata: ...", "Second metadata: ...")
tf2 <- tempfile()
writeLines(metadat, tf2)

x <- importSample(file.features=tf1, file.meta=tf2, dir.save=tempdir())

RclusTool documentation built on Feb. 4, 2020, 5:08 p.m.