Learn R Programming

cocoreg (version 0.1.1)

cocoreg: The Common Components by Regression (CoCoReg) algorithm

Description

An algorithm that extracts common variation between datasets using regression.

Usage

cocoreg(data, cyclic = FALSE, mapping_function = mapping_lm,
  sample_paths = FALSE, center_data = T, scale_data = F)

Arguments

data
[1,K] list of data.frames.
cyclic
boolean, Operation mode: cyclic or non-cyclic
mapping_function
function, The function to use in mappings. See mapping_lm() for an example.
sample_paths
boolean, If FALSE all paths are computed. If TRUE a subset of paths is taken: one (random) path for each starting point. Currently implemented only for cyclic=F.
center_data
boolean, Should the data be centered?
scale_data
boolean, Should the data be scaled?

Value

A list with elements:
$data:
[1,K] list of data.frames containing the joint information, organised identically to the input data.
$mappings:
[1,K*K-K] list of functions, mappings between datasets
$paths:
[(K-1)(K-2)!, K] list of lists, paths for each data set
$cyclic:
input cyclic as is
$sample_paths:
boolean, TRUE if paths have been sampled, FALSE otherwise.
$dataid:
string, Dataset identifier string
$method:
string, Analysis method identifier string
$wall_time_taken:
[1,1] double, Time taken to run the analysis in seconds

Examples

Run this code
dc <- create_syn_data_toy()
ccr <- cocoreg(dc$data)

ggplot_dflst(dc$data, ncol=1)
ggplot_dflst(ccr$data, ncol=1)

## Not run: ------------------------------------
# ggplot_dclst(list(orig = dc$data, ccr = ccr$data)) 
# ggplot_dclst(list(orig = dc$data, shared = ccr$data), legendMode = 'none')
# ggplot_dclst(list(orig = dc$data, ccr = ccr$data), legendMode = 'all')
## ---------------------------------------------

Run the code above in your browser using DataLab