docs/functions/add.data.md

add.data

Add a dataset to a SPEARobject. Needs to have the same number of datasets/columns as SPEARobject$data$train$Xlist. Response not required (will be recorded as NULL). Can be accessed via SPEARobject$data$__name__.

Description

Add a dataset to a SPEARobject. Needs to have the same number of datasets/columns as SPEARobject$data$train$Xlist. Response not required (will be recorded as NULL). Can be accessed via SPEARobject$data$__name__.

Usage

add.data(X, Y = NULL, Z = NULL, name = NULL)

Arguments

Argument |Description ------------- |---------------- X | List of explanatory dataset matrices. Needs to have same column names and length (number of matrices) as SPEARobject$data$Xlist. Y | Response matrix. Needs to have the same number of rows/length as the number of rows in parameter X. Defaults to NULL (not required). Z | Full matrix with all data. Cannot have missing values; must be imputed. If left blank (NULL) will be equivalent to do.call("cbind", X) after imputation. name | Name for the stored dataset in the SPEARobject. Access via SPEARobject$data$__name__.

Examples

SPEARobj <- make.SPEARobject(...)

X.test = ... # Define X.test as a list of matrices that have the same columns as SPEARobj$data$train$Xlist
SPEARobj$add.data(X = X.test) # will default name to "dataset1"

X.test2 = ...
Y.test2 = ...
SPEARobj$add.data(X = X.test2, Y = Y.test2, name = "test2")


jgygi/SPEAR documentation built on July 5, 2023, 5:35 p.m.