diff --git a/R/profile.R b/R/profile.R index 2b466c6..7278f53 100644 --- a/R/profile.R +++ b/R/profile.R @@ -356,8 +356,24 @@ plot.eprof <- function(x, ...) { } else{ xlim <- args$xlim } - plot(NULL, type = "n", bty = "l", xlim = xlim, ylim = ylim, xlab = ifelse(!tikz, - expression(psi), "$\\psi$"), ylab = "Profile log likelihood") + if(is.null(args$xlab)){ + xlab <- ifelse(!tikz, + expression(psi), + "$\\psi$") + } else{ + xlab <- args$xlab + } + if(is.null(args$ylab)){ + ylab <- "profile log likelihood" + } else{ + ylab <- args$ylab + } + plot(NULL, type = "n", + bty = "l", + xlim = xlim, + ylim = ylim, + xlab = xlab, + ylab = ylab) abline(h = -qchisq(level, 1)/2, col = "gray") # Legend lcols <- NULL @@ -1485,9 +1501,9 @@ gpd.pll <- function(psi, param = c("scale", "shape", "quant", "VaR", "ES", "Nmea std.error <- sqrt(solve(gpdr.infomat(par = mle, dat = dat, method = "exp", m = m))[1, 1]) constr.mle.quant <- function(quant) { - suppressMessages(Rsolnp::solnp(par = 0.01, function(lambda, psi, m) { + suppressWarnings(suppressMessages(Rsolnp::solnp(par = 0.01, function(lambda, psi, m) { -gpdr.ll(par = c(psi, lambda), dat = dat, m = m) - }, psi = quant, m = m, control = list(trace = 0))$par) + }, psi = quant, m = m, control = list(trace = 0))$par)) } @@ -1913,6 +1929,7 @@ gpd.pll <- function(psi, param = c("scale", "shape", "quant", "VaR", "ES", "Nmea } ans$family <- "gpd" ans$threshold <- threshold + ans$param <- param if(plot){ plot(ans) } @@ -1960,7 +1977,6 @@ plot.fr <- function(x, ...) { } else if (sum(c(1, 2, 3, 4) %in% whichPlot) == 2) { par(mfrow = c(1, 2)) } - fr <- x xl <- ifelse(is.null(fr$param), expression(psi), fr$param) diff --git a/R/rgparp.R b/R/rgparp.R index b2a4004..741bace 100644 --- a/R/rgparp.R +++ b/R/rgparp.R @@ -35,7 +35,7 @@ rparp <- function(n, shape = 1, riskf = c("sum", "site", "max", "min", "l2"), # Body of rmevspec models <- c("log", "neglog", "bilog", "negbilog", "hr", "br", "xstud", "smith", "schlather", "ct", "sdir", "dirmix", "negdir", "dir") - model <- match.arg(model, models)[1] + model <- match.arg(model, models, several.ok = TRUE)[1] if (model == "schlather") { if (!missing(param)) warning("Parameter value (degrees of freedom) set to one for Schlather model") diff --git a/README.md b/README.md index d928a3d..db57e97 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # `mev`: Modelling Extreme values -[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/mev)](https://cran.r-project.org/package=mev) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version-last-release/mev)](https://cran.r-project.org/package=mev) [![License](https://img.shields.io/badge/license-GPL%20%28%3E=%203%29-blue.svg?style=flat)](http://www.gnu.org/licenses/gpl-3.0.html) [![Downloads](http://cranlogs.r-pkg.org/badges/mev?color=brightgreen)](http://www.r-pkg.org/pkg/mev)