scale_fileapply_pass_1: Helper Function for Computing Preconditioning and Centering

Usage Arguments Examples

View source: R/Scale_Logistic.R

Usage

1
scale_fileapply_pass_1(fnm = "combined_data_1.RData", pathformstart = "scale_precomp_1_", directory = getwd())

Arguments

fnm
pathformstart
directory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (fnm = "combined_data_1.RData", pathformstart = "scale_precomp_1_", 
    directory = getwd()) 
{
    file.names <- dir(path = directory, pattern = pathformstart, 
        full.names = TRUE)
    combined.data_1 <- list()
    for (i in 1:length(file.names)) {
        flist <- NULL
        flist <- ls()
        load(file.names[i], envir = .GlobalEnv)
        run <- as.integer(substring(file.names[i], nchar(directory) + 
            nchar(pathformstart) + 2, nchar(file.names[i]) - 
            nchar(".RData")))
        combined.data_1[[i]] <- list(run = run, subset = subset, 
            idx.start = idx.start, idx.end = idx.end, center = center, 
            precon = precon, precon.inv = precon.inv)
        rm(list = ls()[ls() %in% flist == FALSE])
    }
    save(file = fnm, combined.data_1 = combined.data_1)
  }

mpoll/scale documentation built on Dec. 9, 2019, 7:15 a.m.