Skip to content

Commit

Permalink
reduce code
Browse files Browse the repository at this point in the history
  • Loading branch information
istfer committed Sep 14, 2017
1 parent d2aa22b commit c735297
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions modules/assim.batch/R/pda.postprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,11 @@ write_sf_posterior <- function(sf.samp.list, sf.prior, sf.filename){

# convert mcmc.list to list of matrices
sf.subset.list <- list()
sf.subset.list[[1]] <- do.call("rbind", sf.samp)

# reformat each sublist such that params have their own list and return
sf.subset <- lapply(seq_along(sf.subset.list), function(x) as.list(data.frame(sf.subset.list[[x]])))

sf.subset.list[[1]] <- as.data.frame(do.call("rbind", sf.samp))

filename.flag <- gsub(".*post.distns\\s*|.Rdata.*", "", basename(sf.filename))

sf.post.distns <- PEcAn.MA::approx.posterior(trait.mcmc = sf.subset[[1]], priors = sf.prior,
sf.post.distns <- PEcAn.MA::approx.posterior(trait.mcmc = sf.subset.list[[1]], priors = sf.prior,
outdir = dirname(sf.filename),
filename.flag = filename.flag)

Expand Down

0 comments on commit c735297

Please sign in to comment.