Learn R Programming

specmine (version 3.1.6)

subset_by_samples_and_xvalues: Subset by samples and x-values

Description

Gets a subset of specific samples and x-values.

Usage

subset_by_samples_and_xvalues(dataset, samples, variables = NULL, 
by.index = FALSE, variable.bounds = NULL, rebuild.factors = TRUE)

Arguments

dataset

list representing the dataset from a metabolomics experiment.

samples

vector with indexes or names of the samples to select

variables

vector with the desired variables to get from the dataset.

by.index

if TRUE, the values of the variables argument are indexes.

variable.bounds

variable bounds used if by.index is FALSE and variables are NULL.

rebuild.factors

if TRUE the metadata factors are rebuilded.

Value

Returns the dataset with the selected samples and x-values.

Examples

Run this code
# NOT RUN {
  ## Example of subsetting samples and x-values
  library(specmine.datasets)
  data(cachexia)
  subset = subset_by_samples_and_xvalues(cachexia, c("PIF_178","NETL_022_V1"), 
	   variables = c("Creatine","Serine"))
# }

Run the code above in your browser using DataLab