regdata {lmomRFA} | R Documentation |
An object of class "regdata"
stores
summary statistics of the data for the sites in a region.
It is a data frame with each row containing data for one site.
The columns should contain
the site name, record length and L-moments
and L-moment ratios, in the order
l_1 (mean),
t (L-CV),
t_3 (L-skewness),
t_4 (L-kurtosis),
t_5,
t_6, etc.
There should be at least four columns, but most functions that use
objects of class "regdata"
typically require more columns.
Six or seven columns (4 or 5 L-moments) is usually
adequate for regional frequency analysis.
Note that the fourth column should contain values of the L-CV t, not the L-scale l_2!
Objects of class "regdata"
are created by as.regdata
,
and by regsamlmu
(with default settings of its arguments).
They are used by several functions in package lmomRFA, including
regavlmom
(which computes regional average L-moments),
regfit
(which fits a regional frequency distribution), and
regtst
(which computes discordancy, heterogeneity and
goodness-of-fit measures).
as.regdata(x, warn.names=TRUE)
x |
R object. |
warn.names |
Logical: if TRUE , warnings are issued if the
column names of x appear to be inconsistent with
what is expected for an object of class "regdata" . |
as.regdata
converts an R object to class "regdata"
.
Only data frames and numeric matrices can be converted.
An object of class "regdata"
.
J. R. M. Hosking hosking@watson.ibm.com
data(Cascades) # 'Cascades' is of class "regdata" Cascades # Create a data frame with site statistics dd<-data.frame( name =c("site 1", "site 2", "site 3"), n =c( 20, 30, 40), mean =c( 100, 110, 120), LCV =c(0.20, 0.25, 0.30), L_skewness=c(0.15, 0.20, 0.25), L_kurtosis=c(0.10, 0.15, 0.20), t_5 =c(0.10, 0.12, 0.14)) # Convert to class "regdata" rdd<-as.regdata(dd) rdd class(rdd)