knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
seedr
is an R package that provides functions to fit hydro and thermal time germination models. These models characterize seed lots by two sets of parameters: (i) the physiological thresholds (water, temperature) between which the seed lot can germinate, and (ii) the physiological-time units that the seed lot needs to accumulate before it can germinate. seedr
fits the hydro time model of Bradford (Gummerson 1986, Bradford 1990, Bewley et al. 2013) and the thermal time model of Garcia-Huidobro (Garcia-Huidobro et al. 1982, Gummerson 1986, Bewley et al. 2013). It allows to fit models to grouped datasets, i.e. datasets containing multiple species, seedlots or experiments.
Install the last version of seedr
from GitHub by running the following code in your R session. Note that you will need to install the package devtools
if you don't have it already:
install.packages("devtools") devtools::install_github("efernandezpascual/seedr")
seedr
# once installed, load seedr library(seedr)
To operate seedr
you need just one function: physiotime()
, a wrapper function that formats your data and fits a hydro/thermal time model. In this vignette, first we will see the basic operations behind physiotime()
, and then we will see how to use physiotime()
.
The first step of a seedr
analysis is processed by the physiodata()
function, which will create a physiodata object storing the germination data in a format adequate for subsequent steps. Importantly, the physiodata can be used for basic visualization of your germination data.
Let's say you have imported your data into R and saved it into a data.frame object called centaury
, which looks like this:
head(centaury, 3)
In your data, each column must be a variable and each row a record. Important: for each germination scoring time, you need to record the number of seeds that germinated at that time, not the cumulative germination count since the start of the experiment.
Now, you can transform your data.frame to a physiodata object like this:
cent <- physiodata(d = centaury, # the name of your data object t = "times", # the column with the scoring times x = "temperature", # the column with the experimental treatment, g = "germinated", # the column with the number of germinated seeds, pg = "germinable") # the column with the total number of viable seeds
You can use summary()
on your physiodata object to get a table in which you will see, for each treatment, the final germination proportions (with 95% binomial confidence interval) and the median germination rate (i.e., the inverse of the time taken for 50% germination, 1/t50):
summary(cent)
Using plot()
on your physiodata object will produce a plot of the cumulative germination curves:
plot(cent)
And using barplot()
on your physiodata object will produce a plot of the final germination proportions and the median germination rate:
barplot(cent)
The example we have seen so far was about a single-group dataset, this is, a dataset about one experiment with one seedlot of one species. If your data has several groups (for example, several species, populations, or treatments of stratification), you must group your data with the groups
argument of physiodata()
. Also, if the column names in your dataset are the same as the default ones we defined, you don't need to indicate them in the call to physiodata()
:
grass <- physiodata(grasses, x = "psi", # in this dataset the treatment is water potential groups = "species") # this dataset has two different species plot(grass)
As long as you are working with a single-group dataset, you can fit Bradford's hydrotime model (Gummerson 1986, Bradford 1990, Bewley et al. 2013) to your physiodata object using the function bradford()
:
anisantha <- physiodata(subset(grasses, species == "Anisantha rubens"), # select only one species x = "psi") b <- bradford(anisantha$proportions) # bradford() uses the $proportions element within the physiodata object b
The result is a bradford object, which can be plotted using plot()
:
plot(b)
Likewise, you can fit Garcia-Huidobro's thermal time model (Garcia-Huidobro et al. 1982, Gummerson 1986, Bewley et al. 2013) to your single-group physiodata object using the function huidobro()
:
malva <- physiodata(subset(centaury, population == "La Malva"), # select only one population x = "temperature") h <- huidobro(malva$proportions) # huidobro() uses the $proportions element within the physiodata object h
The result is a huidobro object, which can be plotted using plot()
:
plot(h)
physiotime()
functionAs we said at the beginning, physiotime()
is the basic function of seedr
, and the only one you need to know for common usage of the package. physiotime()
allows to centralize the operations described in the previous sections. It creates your physiodata object, divides it in the groups
you indicate, and fits the model named in its method
argument:
m <- physiotime(d = centaury, # the name of your data object t = "times", # the column with the scoring times x = "temperature", # the column with the experimental treatment, g = "germinated", # the column with the number of germinated seeds, pg = "germinable", # the column with the total number of viable seeds groups = c("species", "population"), # the columns with grouping variables method = "huidobro") # the model to fit, in this case a thermal time model m
physiotime()
can accept further arguments to tune the fitting of the thermal time model, but generally you don't need to touch these. You can read more about these extra arguments by running ?physiotime
in R.
The result of physiotime()
is a physiotime object. Using summary()
on this object, you obtain a table of the fitted model parameters, which is easy to export for further uses:
summary(m)
Likewise, plot()
will plot the fitted models:
plot(m)
If you encounter a clear bug, please file an issue with a minimal reproducible example on GitHub.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.