-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
85 lines (62 loc) · 2.28 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# flowers
<!-- badges: start -->
<!-- badges: end -->
The goal of flowers is to provide a lodgepole pine flowering phenology dataset in an accessible format. This package contains 15 years of lodgepole pine (Pinus contorta var. latifolia) phenology data for pollen shed and cone receptivity. The data were collected in seed orchards in British Columbia and represents multiple BC provenances.
## Installation
<!--
You can install the released version of flowers from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("flowers")
```
-->
You can install the development version of flowers from [GitHub](/~https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("scisus/flowers")
```
## Example
Read in phenology data sets from the package.
```{r example}
library(flowers)
## basic example code
state <- flowers::lodgepole_phenology_state
head(state)
event <- flowers::lodgepole_phenology_event
head(event)
```
Lodgepole pine in BC generally flowers in May and June.
```{r day_of_year_plot, echo = FALSE, warning = FALSE, message = FALSE}
library(ggplot2)
library(dplyr)
library(lubridate)
flowering <- state %>%
filter(State == 2) %>%
mutate(Year = as.factor(Year))
ggplot(flowering, aes(x=Site, y=DoY, group=interaction(Site, Year), colour = Site)) +
geom_line( alpha=0.5, size=3) +
#geom_point(alpha=0.1) +
scale_colour_brewer(type="div", palette = 8) +
facet_wrap("Sex") +
theme_dark() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
geom_abline(intercept = 122, slope = 0) +
geom_abline(intercept = 153, slope = 0) +
coord_flip() +
ggtitle("Day of year trees observed flowering at 7 sites", subtitle = "Lodgepole pine observed between 1997 and 2012. Vertical lines at May and June 1")
```
Data is from `r length(unique(state$Clone))` clones in
`r length(unique(state$Orchard))` orchards grown at
`r length(unique(state$Site))` BC seed orchard sites and observed between `r min(state$Year, na.rm=TRUE)`
and `r max(state$Year, na.rm=TRUE)`.