Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco De Lucia
RedModRphree
Commits
8dc0e21e
Commit
8dc0e21e
authored
May 06, 2018
by
Marco De Lucia
Browse files
FlattenList commented out
parent
ddacccde
Changes
3
Hide whitespace changes
Inline
Side-by-side
NAMESPACE
View file @
8dc0e21e
...
...
@@ -20,7 +20,6 @@ export(FindAllSpeciesNames)
export(FindAllTotNames)
export(FindLogK)
export(FindPhase)
export(FlattenList)
export(FormulaFromBal)
export(Matplot)
export(MatplotSingle)
...
...
R/Rphree_SurrogateUtils.R
View file @
8dc0e21e
## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2018
### Time-stamp: "Last modified 2018-05-0
3 17:37:31
delucia"
### Time-stamp: "Last modified 2018-05-0
6 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
...
...
man/FlattenList.Rd
deleted
100644 → 0
View file @
ddacccde
% 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
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment