spline_multi: spline_multi

Description Usage Arguments Value Examples

View source: R/spline_multi.R

Description

Identification of annual bloom descriptors dates based on smoothing splines for all the species of the dataframe. The function automatically exludes those years containing less than 75% of the possible observations for the temporal scale considered.

Usage

1
spline_multi(x, ab_treshold = 0.75, obs_year = 2, s_param = 0.35, t_scale = 52)

Arguments

x

a dataframe having the first 7 columns named as "location", "station", "date", "year", "month", "week", "day", other columns corresponds to the species columns

ab_treshold

quantile of the positive abundance distribution (default 0.75)

obs_year

minimum number of samples for each year in which the species shows an abundance>0 (default 2)

s_param

the smoothing parameter corresponding to the spar parameters of the smooth.spline function (default 0.35).

t_scale

temporal scale resolution of the data, 52 for weekly data, 12 for monthly data (default 52)

Value

a dataframe containing the species names, the annual time vector, the value vector and info a character vector with 'Start', 'Max' and 'End' for the seasonal peak and NA for the other date

Examples

1
2
3
4
5
6
7
## Not run: 
  data("phytopknar")
   phytopknar_ret <- ret_time(phytopknar)
   phytopknar_ret_ord <- phytopknar_ret %>% dplyr::select(location,station,date,year,month,week,day,everything())
   spline_multi(phytopknar_ret_ord,ab_treshold=0.75,obs_year=2,s_param=0.35,t_scale=52)

## End(Not run)

ldbk/Rplanktonanalytic documentation built on June 29, 2021, 9:23 p.m.