Skip to content
Snippets Groups Projects
Commit 8dc0e21e authored by Marco De Lucia's avatar Marco De Lucia
Browse files

FlattenList commented out

parent ddacccde
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,6 @@ export(FindAllSpeciesNames)
export(FindAllTotNames)
export(FindLogK)
export(FindPhase)
export(FlattenList)
export(FormulaFromBal)
export(Matplot)
export(MatplotSingle)
......
## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2018
### Time-stamp: "Last modified 2018-05-03 17:37:31 delucia"
### Time-stamp: "Last modified 2018-05-06 20:16:47 delucia"
##' Computes the average of absolute values of a vector
##' @title Average of absolute values
......@@ -26,30 +26,26 @@ mae <- function(x) mean(abs(x))
## return(res)
## }
## SoftMaxBackTransf <- function(vec, back) return(log(vec)+log(back))
##' @title Flatten out a Rphree list
##' @param list list of Rphree lists
##' @param strip logical, should we delete "ListInfo"? Defaults to
##' true
##' @return a list whose elements are single Rphree simulations
##' @author MDL
##' @export
FlattenList <- function(list, strip=TRUE) {
if (strip)
stripped <- sapply(list, StripInfo)
else
stripped <- list
tot <- vector(mode="list", length=sum(sapply(stripped, length)))
k <- 1
for (i in seq_along(stripped)) {
for (j in seq_along(stripped[[i]])) {
tot[[k]] <- stripped[[i]][[j]]
k=k+1
}
}
return(tot)
}
## ## SoftMaxBackTransf <- function(vec, back) return(log(vec)+log(back))
## ##' @title Flatten out a Rphree list
## ##' @param list list of Rphree lists
## ##' @param strip logical, should we delete "ListInfo"? Defaults to
## ##' true
## ##' @return a list whose elements are single Rphree simulations
## ##' @author MDL
## ##' @export
## FlattenList <- function(list) {
## tot <- vector(mode="list", length=sum(sapply(stripped, length)))
## k <- 1
## for (i in seq_along(stripped)) {
## for (j in seq_along(stripped[[i]])) {
## tot[[k]] <- stripped[[i]][[j]]
## k=k+1
## }
## }
## return(tot)
## }
##' @title Find all species occurring in the ensemble
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_SurrogateUtils.R
\name{FlattenList}
\alias{FlattenList}
\title{Flatten out a Rphree list}
\usage{
FlattenList(list, strip = TRUE)
}
\arguments{
\item{list}{list of Rphree lists}
\item{strip}{logical, should we delete "ListInfo"? Defaults to
true}
}
\value{
a list whose elements are single Rphree simulations
}
\author{
MDL
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment