diff --git a/scripts/compile_lda_runs.R b/scripts/compile_lda_runs.R index afb9a28..2db11cd 100644 --- a/scripts/compile_lda_runs.R +++ b/scripts/compile_lda_runs.R @@ -16,11 +16,11 @@ n <- length(files) # Set up two data structures: "fits", a list used to store all the # results; and "dat", a data frame summarizing the model parameters # and optimization settings used to produce these fits. -fits <- vector("list",n) +# fits <- vector("list",n) labels <- files labels <- str_remove(labels,paste(outdir,"/",sep = "")) labels <- str_remove(labels,".rds") -names(fits) <- labels +# names(fits) <- labels dat <- data.frame(label = labels, k = 0, method = "", @@ -31,7 +31,7 @@ dat <- data.frame(label = labels, # Load the results from the RDS files. for (i in 1:n) { out <- readRDS(files[i]) - fits[[i]] <- out$lda + # fits[[i]] <- out$lda dat[i,"k"] <- out$lda@k dat[i,"method"] <- unlist(strsplit(labels[i],"-"))[3] dat[i,"extrapolate"] <- grepl("ex",labels[i],fixed = TRUE) @@ -39,16 +39,15 @@ for (i in 1:n) { } # Reorder the results in "fits" and "dat". -dat <- transform(dat,method = factor(method,c("em","scd"))) +dat <- transform(dat,method = factor(method,c("noinit","em","scd"))) i <- with(dat,order(k,extrapolate,method)) dat <- dat[i,] -fits <- fits[i] +# fits <- fits[i] rownames(dat) <- NULL # Convert the "k" column to a factor. dat <- transform(dat,k = factor(k)) # Save the combined results to an .RData file. -save(list = c("dat","fits"), - file = rdafile) +save(list = "dat",file = rdafile) resaveRdaFiles(rdafile)