diff --git a/NAMESPACE b/NAMESPACE index 6a469d3..f6c42db 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,3 +10,10 @@ export(rate_change_interval) export(synchrony) export(turnover) export(variance_ratio) +importFrom(permute,shuffleSeries) +importFrom(stats,aggregate) +importFrom(stats,as.formula) +importFrom(stats,coef) +importFrom(stats,confint) +importFrom(stats,sd) +importFrom(stats,var) diff --git a/R/community_stability.R b/R/community_stability.R index e9724dc..732a8df 100644 --- a/R/community_stability.R +++ b/R/community_stability.R @@ -25,6 +25,7 @@ #' time.var = "year", #' abundance.var = "abundance", #' replicate.var = "subplot") # across all subplots +#' @importFrom stats aggregate as.formula sd #' @export community_stability <- function(df, time.var, diff --git a/R/rate_change.R b/R/rate_change.R index d790c7a..eda38d2 100644 --- a/R/rate_change.R +++ b/R/rate_change.R @@ -41,6 +41,7 @@ #' species.var = "species", #' abundance.var = "abundance", #' replicate.var = "subplot") # across all subplots +#' @importFrom stats coef #' @export rate_change <- function(df, time.var, species.var, diff --git a/R/synchrony.R b/R/synchrony.R index 1a72629..fa13f58 100644 --- a/R/synchrony.R +++ b/R/synchrony.R @@ -46,6 +46,7 @@ #' replicate.var = "subplot", #' metric="Gross") # With Gross et al. (2014) metric. #' } +#' @importFrom stats aggregate as.formula sd #' @export synchrony <- function(df, time.var, species.var, diff --git a/R/temporal_torus_translation.R b/R/temporal_torus_translation.R index 3cccd60..b568683 100644 --- a/R/temporal_torus_translation.R +++ b/R/temporal_torus_translation.R @@ -28,6 +28,7 @@ #' Hallett, Lauren M., Joanna S. Hsu, Elsa E. Cleland, Scott L. Collins, Timothy L. Dickson, Emily C. Farrer, Laureano A. Gherardi, et al. "Biotic Mechanisms of Community Stability Shift along a Precipitation Gradient." Ecology 95, no. 6 (2014): 1693-1700. #' #' Harms, Kyle E., Richard Condit, Stephen P. Hubbell, and Robin B. Foster. "Habitat Associations of Trees and Shrubs in a 50-Ha Neotropical Forest Plot." Journal of Ecology 89, no. 6 (2001): 947-59. +#' @importFrom stats confint #' @export cyclic_shift <- function(df, time.var, species.var, @@ -148,6 +149,7 @@ confint.cyclic_shift <- function(object, #' #' @param comdat A community dataframe #' @return rand.comdat A randomized community dataframe +#' @importFrom permute shuffleSeries shuffle_community <- function(comdat){ # create empty matrix with same number of rows, columns as comdat diff --git a/R/utilities.R b/R/utilities.R index ecc0d16..abf21b1 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -94,6 +94,7 @@ check_multispp <- function(df, species.var, replicate.var){ #' Utility function to stop calculations if the species never change in a replicate #' @param comdat A community dataframe +#' @importFrom stats var check_sppvar <- function(comdat){ sppvar <- sum(apply(comdat, 2, var)) if(sppvar == 0) diff --git a/R/variance_ratio.R b/R/variance_ratio.R index ab70172..cd4685e 100644 --- a/R/variance_ratio.R +++ b/R/variance_ratio.R @@ -52,6 +52,7 @@ #' #' Schluter, Dolph. (1984) "A Variance Test for Detecting Species Associations, #' with Some Example Applications." Ecology 65, no. 3: 998-1005. doi:10.2307/1938071. +#' @importFrom stats aggregate confint #' @export #' @examples #' data(knz_001d)