Description Usage Arguments Details Value Author(s) Examples
Attempts to turn its argument into a rwl object.
1 | as.rwl(x)
|
x |
a |
This tries to coerce x
into class c("rwl","data.frame")
. Failable.
An object of class c("rwl", "data.frame")
with the series in
columns and the years as rows. The series IDs are the
column names and the years are the row names.
Andy Bunn. Patched and improved by Mikko Korpela.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(graphics)
library(stats)
library(utils)
## Toy
n <- 100
## Make a data.frame that is tree-ring like
base.series <- 0.75 + exp(-0.2 * 1:n)
foo <- data.frame(x1 = base.series + abs(rnorm(n, 0, 0.25)),
x2 = base.series + abs(rnorm(n, 0, 0.25)),
x3 = base.series + abs(rnorm(n, 0, 0.25)),
x4 = base.series + abs(rnorm(n, 0, 0.25)),
x5 = base.series + abs(rnorm(n, 0, 0.25)),
x6 = base.series + abs(rnorm(n, 0, 0.25)))
# coerce to rwl and use plot and summary methods
foo <- as.rwl(foo)
class(foo)
plot(foo, plot.type="spag")
summary(foo)
|
[1] "rwl" "data.frame"
series first last year mean median stdev skew gini ar1
1 x1 1 100 100 1.008 0.943 0.203 1.401 0.105 0.371
2 x2 1 100 100 1.033 0.973 0.229 1.108 0.119 0.280
3 x3 1 100 100 0.994 0.941 0.219 1.942 0.108 0.565
4 x4 1 100 100 0.977 0.915 0.199 1.661 0.102 0.289
5 x5 1 100 100 0.993 0.956 0.206 1.606 0.106 0.250
6 x6 1 100 100 0.991 0.928 0.211 1.411 0.112 0.428
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.