PLSR_from_file_and_predict_second_dataset: Partial Least Squares and predict second dataset

View source: R/PLSR_from_file_and_predict_second_dataset.R

PLSR_from_file_and_predict_second_datasetR Documentation

Partial Least Squares and predict second dataset

Description

Builds PLS model from training dataset and predicts second dataset Writes out predicted.scores of the second dataset Plots original PLS, projected samples only, and projected samples ontop of original PLS

Usage

PLSR_from_file_and_predict_second_dataset(
  file,
  file2,
  sample.names,
  sample.type,
  y.response,
  sample.names2 = NULL,
  sample.type2 = NULL,
  train_string,
  title = "PLSR",
  comp.x = "comp1",
  comp.y = "comp2",
  comps = 5,
  scale = F,
  labels = F,
  fread = FALSE
)

Arguments

file

file for X matirx

file2

file for test data matrix

sample.names

Vector of sample names in X matrix

sample.type

vector of sample groups

y.response

numeric vector of response values in same order as samples

sample.names2

Vector of sample names in 2nd dataset, if needed

sample.type2

Vector of sample types in 2nd dataset, if needed

train_string

string to insert in file name of predicted scores

title

title of the plot

comp.x, comp.y

comps to display

comps

number of components to compute

scale

default=T

labels

label the plot, default = T

fread

default=F, use fread for large input files


graeberlab-ucla/glab.library documentation built on Oct. 28, 2024, 10:48 a.m.