pivotAtSite: Pivot at-site data

Description Usage Arguments Examples

Description

Returns a matrix of a given variable with time in rows and station index in columns. Useful to obtain observations that occur at the same time.

Usage

1
2
3
4
pivotAtSite(x, ...)

## S3 method for class 'formula'
pivotAtSite(form, x)

Arguments

x

Data.frame containing at-site date. If x is passed directly without formula, it is assumed that the first three columns are: station index, time, variable.

form

Formula that specify the variable of interest in x as well as time and location indexes.

Examples

1
2
3
4
5
6
7
8
site1 <- data.frame(site = 1, year = seq(2000,2010),
                     v =rnorm(11), w =rnorm(11))
site2 <- data.frame(site = 2, year = seq(1995,2007),
                     v =rnorm(13), w =rnorm(13))
site3 <- data.frame(site = 3, year = seq(1995,2010),
                     v =rnorm(16), w =rnorm(16))
xdf <- rbind(site1,site2, site3)
xdf; pivotAtSite(v~year+site,xdf)

martindurocher/floodRFA documentation built on June 5, 2019, 8:44 p.m.