tidy.rWind_series: Transforming a rWind_series object into a data.frame

Description Usage Arguments Examples

View source: R/wind_functions2.R

Description

The output of tidy is always a data.frame. It is therefore suited for further manipulation by packages like dplyr, reshape2, ggplot2 and ggvis.

Usage

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

## S3 method for class 'rWind_series'
tidy(x, ...)

Arguments

x

An object to be converted into a tidy data.frame

...

extra arguments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(wind.series)
df <- tidy(wind.series)
head(df)
## Not run: 
# use the tidyverse
library(dplyr)
mean_speed <- tidy(wind.series) %>%
  group_by(lat, lon) %>%
  summarise(speed = mean(speed))
wind_average2 <- wind.mean(wind.series)
all.equal(wind_average2$speed, mean_speed$speed)

## End(Not run)

rWind documentation built on Oct. 19, 2021, 5:06 p.m.