Learn R Programming

eNetXplorer (version 1.1.2)

mergeObj: merges eNetXplorer objects with different alphas

Description

Upon sequential or parallel execution of two or more eNetXplorer runs with different values of the mixing parameter alpha, and assuming the objects from those runs have been saved, this function creates a new eNetXplorer object that merges the alpha values. It currently supports linear (gaussian), logistic (binomial), and Cox regression models.

Usage

mergeObj(source_obj, source_dir=getwd(), dest_obj="eNet_merged.Robj",
dest_dir=NULL)

Arguments

source_obj

Vector with the names of two or more eNetXplorer objects.

source_dir

Source directory. Default is the working directory.

dest_obj

Name of the merged eNetXplorer object.

dest_dir

Destination directory. If not specified, it will use source_dir as default.

See Also

eNetXplorer

Examples

Run this code
# NOT RUN {
# we first generate two objects over different alpha values, then merge them.
data(QuickStartEx)
working_dir = tempdir()
fit1 = eNetXplorer(x=QuickStartEx$predictor,y=QuickStartEx$response,
family="gaussian",alpha=seq(0,1,by=0.2),save_obj=TRUE,dest_dir=working_dir,
dest_obj="eNet1.Robj",n_run=20,n_perm_null=10,seed=111)
fit2 = eNetXplorer(x=QuickStartEx$predictor,y=QuickStartEx$response,
family="gaussian",alpha=seq(0.1,0.9,by=0.2),save_obj=TRUE,dest_dir=working_dir,
dest_obj="eNet2.Robj",n_run=20,n_perm_null=10,seed=111)
mergeObj(source_obj=c("eNet1.Robj","eNet2.Robj"),source_dir=working_dir)

# we generate summary PDFs to compare the results before and after merging.
summaryPDF(fit1, dest_file="eNet1.pdf",dest_dir=working_dir)
summaryPDF(fit2, dest_file="eNet2.pdf",dest_dir=working_dir)
load(file.path(working_dir,"eNet_merged.Robj"))
summaryPDF(eNet,dest_file="eNet_merged.pdf",dest_dir=working_dir)
# }

Run the code above in your browser using DataLab