as.PWMs | R Documentation |
Convert vector, matrix, list, or data.frame to PWMs-objects.
as.PWMs(x, ..., order = NULL) ## S3 method for class 'numeric' as.PWMs(x, order = seq_along(x) - 1, ...) ## S3 method for class 'matrix' as.PWMs(x, order = row(x)[, 1] - 1, ...) ## S3 method for class 'list' as.PWMs(x, order = seq_along(x[[1]]) - 1, ...) ## S3 method for class 'data.frame' as.PWMs(x, formula, order = NULL, ...)
x |
vector or matrix of PWMs. |
... |
additional arguments. |
order |
integer, corresponding order to given PWMs. If NULL, order is set to 0:(length(x)-1). |
formula |
if |
object of class PWMs, see PWMs help page.
numeric
: as.PWMs for numeric data vectors
matrix
: as.PWMs for numeric data matrices
list
: as.PWMs for numeric data lists
data.frame
: as.PWMs for numeric data.frames
PWMs
xmat <- cbind(c(0.12, .41, .38, .33), c(.05, 0.28, .25, .22)) xvec <- xmat[, 1] xlist <- lapply(1:ncol(xmat), function(i) xmat[, i]) xdat <- data.frame( station = letters[1:3], season = c("S", "W", "S"), b0 = c(.12, .15, .05), b1 = c(.41, .33, .28), b2 = c(.38, .18, .25) ) as.PWMs(xvec) as.PWMs(xvec[-2], order = c(0, 2, 3)) as.PWMs(xmat) as.PWMs(xmat[-2, ], order = c(0, 2, 3)) as.PWMs(xlist) as.PWMs(xdat, cbind(b0, b1, b2) ~ station) as.PWMs(xdat, . ~ station + season) as.PWMs(xdat, cbind(b0, b2) ~ station, order = c(0, 2)) p <- as.PWMs(xdat, cbind(b0, b1, b2) ~ station) TLMoments(p) (p <- as.PWMs(xdat, cbind(b0, b1) ~ station)) #parameters(TLMoments(p), "gev") # => error #parameters(TLMoments(p), "gpd") # => error parameters(TLMoments(p), "gpd", u = 10) (p <- as.PWMs(xdat, cbind(b0, b2) ~ station, order = c(0, 2))) #TLMoments(p) # => error
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.