Commit 5de7bccb authored by Laura Mack's avatar Laura Mack
Browse files

import pblapply instead of pbsapply

parent f873df79
......@@ -27,7 +27,7 @@ importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,title)
importFrom(ismev,gev.fit)
importFrom(pbapply,pbsapply)
importFrom(pbapply,pblapply)
importFrom(stats,lm)
importFrom(stats,make.link)
importFrom(stats,median)
......
......@@ -20,7 +20,7 @@
#' for which block max. should still be calculated.
#' @param which.stations optional, subset of stations. Either numeric vector or character vector
#' containing names of elements in data. If not given, all elements in `data` will be used.
#' @param which.mon optional, subset of months of which to calculate the annual maxima from.
#' @param which.mon optional, subset of months (as list containing values from 0 to 11) of which to calculate the annual maxima from.
#' @param names optional, character vector of length 2, containing the names of the columns to be used.
#' @param cl optional, number of cores to be used from \code{\link[pbapply]{pblapply}} for parallelization.
#'
......@@ -34,7 +34,7 @@
#' @seealso \code{\link{pgev.d}}
#'
#' @export
#' @importFrom pbapply pbsapply
#' @importFrom pbapply pblapply
#' @importFrom RcppRoll roll_sum
#' @importFrom fastmatch ctapply
#'
......@@ -75,7 +75,7 @@
runsum <- runsum/ds #intensity per hour
max.subset <- lapply(1:length(which.mon),function(m.i){
subset <- is.element(as.POSIXlt(data.s[,names[1]])$mon,which.mon[[m.i]])
max <- ctapply(runsum[subset],(as.POSIXlt(data.s[,names[1]])$year+1900)[subset],
max <- fastmatch::ctapply(runsum[subset],(as.POSIXlt(data.s[,names[1]])$year+1900)[subset],
function(vec){
n.na <- sum(is.na(vec))
max <- ifelse(n.na <= na.accept*length(vec),max(vec,na.rm = TRUE),NA)
......
......@@ -147,7 +147,7 @@ qgev.d <- function(p,mut,sigma0,xi,theta,eta,d,...) {
'This is not intended and might cause an error.')}
if (d<=0) {stop('The duration d has to be positive.')}
if(any(d+theta<=0)){
warning('Some shape parameters are negative,resulting from a negativ theta '
warning('Some shape parameters are negative, resulting from a negativ theta '
,theta, ' this will prododuce NAs.')}
# if denominator is negative NAs will be returned
if(d+theta<=0){return(rep(NA,length(p)))}else{
......
......@@ -51,7 +51,7 @@
#' \item{data}{data is standardized to standard Gumbel.}
#' \item{cov}{The covariance matrix.}
#' \item{vals}{Parameter values for every data point.}
#' \item{init.vals}{Initial values that where used.}
#' \item{init.vals}{Initial values that were used.}
#' \item{ds}{Durations for every data point.}
#' @seealso \code{\link{dgev.d}}, \code{\link{IDF.agg}}, \code{\link{gev.fit}}, \code{\link{optim}}
#' @export
......
......@@ -29,7 +29,7 @@ for which block max. should still be calculated.}
\item{which.stations}{optional, subset of stations. Either numeric vector or character vector
containing names of elements in data. If not given, all elements in `data` will be used.}
\item{which.mon}{optional, subset of months of which to calculate the annual maxima from.}
\item{which.mon}{optional, subset of months (as list containing values from 0 to 11) of which to calculate the annual maxima from.}
\item{names}{optional, character vector of length 2, containing the names of the columns to be used.}
......
......@@ -79,7 +79,7 @@ A zero indicates successful convergence.}
\item{data}{data is standardized to standard Gumbel.}
\item{cov}{The covariance matrix.}
\item{vals}{Parameter values for every data point.}
\item{init.vals}{Initial values that where used.}
\item{init.vals}{Initial values that were used.}
\item{ds}{Durations for every data point.}
}
\description{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment