From dcf6099f44e8b66290132bee97a86a00b4b2a360 Mon Sep 17 00:00:00 2001 From: adw96 Date: Sun, 5 Aug 2018 21:42:37 -0400 Subject: [PATCH] deal with some CRAN checks notes --- NAMESPACE | 23 + R/model_betta copy.Rcopy | 374 ------------- R/model_betta.R | 47 +- R/richness_breakaway.R | 1 + R/richness_chao.Rzzzz | 518 ------------------ R/richness_wlrm_t.R | 1 + R/richness_wlrm_ut.R | 3 +- build-test-breakaway.R | 46 -- docs/TODO.html | 2 +- docs/articles/breakaway.html | 2 +- docs/articles/extended-tutorial.html | 2 +- docs/articles/index.html | 4 - docs/articles/resample-estimates.html | 2 +- docs/articles/sample-size-calculations.html | 2 +- docs/index.html | 6 +- docs/pkgdown.yml | 4 - docs/reference/alpha_estimate.html | 4 - docs/reference/alpha_estimates.html | 4 - docs/reference/apples.html | 4 - docs/reference/betta.html | 10 +- docs/reference/betta_pic.html | 6 +- docs/reference/betta_random.html | 48 +- docs/reference/breakaway.html | 12 +- docs/reference/breakaway_nof1.html | 12 +- .../build_frequency_count_tables.html | 4 - docs/reference/chao1.html | 8 - docs/reference/chao1_bc.html | 8 - docs/reference/chao_bunge.html | 8 - docs/reference/chao_shen.html | 2 +- docs/reference/check_format.html | 4 - docs/reference/convert.html | 4 - docs/reference/cutoff_wrap.html | 2 +- docs/reference/good_turing.html | 2 +- docs/reference/hawaii.html | 4 - docs/reference/index.html | 4 - docs/reference/kemp.html | 2 +- docs/reference/make_design_matrix.html | 2 +- .../reference/make_frequency_count_table.html | 4 - docs/reference/objective_bayes_geometric.html | 2 +- docs/reference/objective_bayes_mixedgeo.html | 2 +- docs/reference/objective_bayes_negbin.html | 2 +- docs/reference/objective_bayes_poisson.html | 2 +- docs/reference/physeq_wrap.html | 2 +- docs/reference/plot.alpha_estimates.html | 2 +- docs/reference/proportions_instead.html | 4 - docs/reference/rnbinomtable.html | 4 - docs/reference/rztnbinomtable.html | 4 - docs/reference/sample_inverse_simpson.html | 2 +- docs/reference/sample_richness.html | 2 +- docs/reference/sample_shannon.html | 2 +- docs/reference/sample_shannon_e.html | 2 +- docs/reference/sample_simpson.html | 2 +- docs/reference/sample_size_estimate.html | 4 - docs/reference/sample_size_figure.html | 4 - docs/reference/toy_metadata.html | 4 - docs/reference/toy_otu_table.html | 4 - docs/reference/toy_taxonomy.html | 4 - docs/reference/true_gini.html | 2 +- docs/reference/true_hill.html | 2 +- docs/reference/true_inverse_simpson.html | 2 +- docs/reference/true_shannon.html | 2 +- docs/reference/true_shannon_e.html | 2 +- docs/reference/true_simpson.html | 2 +- docs/reference/wlrm_transformed.html | 12 +- docs/reference/wlrm_untransformed.html | 12 +- man/betta_random.Rd | 42 -- 66 files changed, 77 insertions(+), 1250 deletions(-) delete mode 100644 R/model_betta copy.Rcopy delete mode 100644 R/richness_chao.Rzzzz delete mode 100644 build-test-breakaway.R diff --git a/NAMESPACE b/NAMESPACE index 2613c74..0bc6f74 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -60,6 +60,7 @@ export(wlrm_untransformed) import(ggplot2) import(magrittr) import(phyloseq) +import(stats) import(tibble) importFrom(graphics,hist) importFrom(graphics,legend) @@ -70,5 +71,27 @@ importFrom(mvtnorm,rmvnorm) importFrom(phyloseq,get_variable) importFrom(phyloseq,sample_data) importFrom(stats,acf) +importFrom(stats,coef) +importFrom(stats,dexp) +importFrom(stats,dgeom) +importFrom(stats,dnbinom) +importFrom(stats,dpois) +importFrom(stats,fitted) +importFrom(stats,lm) +importFrom(stats,model.matrix) +importFrom(stats,nls) +importFrom(stats,optim) +importFrom(stats,pchisq) +importFrom(stats,pnorm) +importFrom(stats,predict) +importFrom(stats,quantile) +importFrom(stats,rbeta) +importFrom(stats,rbinom) +importFrom(stats,rnbinom) +importFrom(stats,rnorm) +importFrom(stats,runif) +importFrom(stats,sd) +importFrom(stats,var) +importFrom(stats,vcov) importFrom(utils,head) importFrom(utils,read.table) diff --git a/R/model_betta copy.Rcopy b/R/model_betta copy.Rcopy deleted file mode 100644 index 9231ba9..0000000 --- a/R/model_betta copy.Rcopy +++ /dev/null @@ -1,374 +0,0 @@ -#' Modelling total diversity with betta -#' -#' This function tests for heterogeneity of total diversity (observed plus -#' unobserved) across multiple sites. It can account or test for fixed effects -#' that may explain diversity. It returns the significance of the covariates in -#' explaining diversity and a hypothesis test for heterogeneity. -#' -#' -#' @param chats A vector of estimates of total diversity at different sampling -#' locations. \samp{breakaway} estimates are suggested in the high-diversity -#' case but not enforced. -#' @param ses The standard errors in \samp{chats}, the diversity estimates. -#' @param X A numeric matrix of covariates. If not supplied, an intercept-only -#' model will be fit. -#' @return \item{table}{ A coefficient table for the model parameters. The -#' columns give the parameter estimates, standard errors, and p-values, -#' respectively. This model is only as effective as your diversity estimation -#' procedure; for this reason please confirm that your estimates are -#' appropriate and that your model is not misspecified. \samp{betta_pic} may be -#' useful for this purpose. } \item{cov}{ Estimated covariance matrix of the -#' parameter estimates. } \item{ssq_u}{ The estimate of the heterogeneity -#' variance. } \item{homogeneity}{ The test statistic and p-value for the test -#' of homogeneity. } \item{global}{ The test statistic and p-value for the -#' test of model explanatory power. } \item{blups}{ The conditional expected -#' values of the diversity estimates (conditional on the random effects). The -#' authors propose that if the practitioner believes that information from one -#' diversity estimator may inform the others, then using the \samp{condfits} as -#' estimators of total diversity rather than \samp{Chats} may reduce variance -#' of diversity estimates by ``sharing strength'' across the samples. } -#' \item{blupses}{ The estimated standard deviation (standard errors) in the -#' blups. } -#' @note Ecologists who are interested in the way species richness varies with -#' covariate information often run a regression-type analysis on the observed -#' diversity using their covariate information as predictors. However, in many -#' settings (especially microbial), rare and unobserved taxa play a hugely -#' important role in explaining the subtleties of the ecosystem, however, a -#' regression analysis on the observed diversity level fails to account for -#' these unobserved taxa. By predicting the total level of diversity (for -#' example, via \code{\link{breakaway}}) and estimating the standard error in -#' the estimate, one can take account of these unobserved, but important, taxa. -#' In order to account for the estimated nature of the response, a mixed model -#' approach is taken, whereby the varying levels of confidence in the estimates -#' contributes to a diagonal but heteroscedastic covariance matrix. Given -#' covariates constitute the fixed effects in the mixed model, and significance -#' of the random effect term ``sigsq_u'' reflects heterogeneity in the sample, -#' that is, variability that cannot be explained by only the covariates. The -#' authors believe this to be the first attempt at modelling total diversity in -#' a way that accounts for its estimated nature. -#' @author Amy Willis -#' @seealso \code{\link{breakaway}}; \code{\link{breakaway_nof1}}; -#' \code{\link{betta_pic}}; \code{\link{apples}} -#' @references Willis, A., Bunge, J., and Whitman, T. (2015). Inference for -#' changes in biodiversity. \emph{arXiv preprint.} -#' -#' Willis, A. and Bunge, J. (2015). Estimating diversity via frequency ratios. -#' \emph{Biometrics.} -#' @keywords diversity -#' @examples -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' betta(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), cbind(1, c(100, 150, 100, -#' 50))) -#' -#' ## handles missing data -#' betta(c(2000, 3000, 4000, 3000), c(100, 200, 150, NA)) -#' -#' ## A test for heterogeneity of apples diversity estimates vs butterfly estimates -#' betta(c(1552, 1500, 884), c(305, 675, 205), cbind(1, c(0, 0, 1))) -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' @export betta -betta <- function(chats,ses,X=NA) { - if (isTRUE(is.na(X))) { X <- matrix(rep(1,length(chats)),ncol=1) } - consider <- !(is.na(chats) | is.na(ses) | apply(is.na(X),1,sum)) - - chats_effective <- chats[consider] - ses_effective <- ses[consider] - X_effective <- as.matrix(X[consider,]) - n <- dim(X_effective)[1] - p <- dim(X_effective)[2] - - likelihood <- function(input) { - ssq_u <- input[1] - beta <- input[2:length(input)] - W <- diag(1/(ssq_u+ses_effective^2)) - -0.5 * (sum(log(ssq_u+ses_effective^2) + - (chats_effective - X_effective %*% beta)^2 / - (ssq_u + ses_effective^2)) + log(det(t(X_effective)%*%W%*%X_effective))) - } - - mystart <- c(var(chats_effective), - solve(t(X_effective)%*%X_effective)%*%t(X_effective)%*%chats_effective) - output <- optim(mystart, likelihood, hessian=FALSE, control=list(fnscale=-1), - lower=c(0,-Inf), method="L-BFGS-B") # fnscale => maximises if -ve - ssq_u <- output$par[1] - beta <- output$par[2:length(output$par)] - - W <- diag(1/(ssq_u+ses_effective^2)) - vars <- 1/diag(t(X_effective)%*%W%*%X_effective) - - global <- t(beta)%*%(t(X_effective)%*%W%*%X_effective)%*%beta ## global test - - Q <- sum((chats_effective-X_effective%*%beta)^2/ses_effective^2) - R <- diag(ses_effective^2); G <- diag(ssq_u,n) - - getvar <- function() { - C <- matrix(NA,nrow=n+p,ncol=n+p); - C[1:p,1:p] <- t(X_effective)%*%solve(R)%*%X_effective; - C[(p+1):(n+p),(p+1):(n+p)] <- solve(R)+solve(G); - C[1:p,(p+1):(n+p)] <- t(X_effective)%*%solve(R); - C[(p+1):(n+p),1:p] <- solve(R)%*%X_effective; - return(solve(C)) - } - - mytable <- list() - mytable$table <- cbind("Estimates"=beta, - "Standard Errors"=sqrt(vars), - "p-values"=round(2*(1-pnorm(abs(beta/sqrt(vars)))),3)) - mytable$cov <- solve(t(X_effective)%*%W%*%X_effective) - mytable$ssq_u <- ssq_u - mytable$homogeneity <- c(Q,1-pchisq(Q,n-p)) - mytable$global <- c(global,1-pchisq(global,p-1)) - - us <- c(ssq_u*W%*%(chats_effective-X_effective%*%beta)) - blups <- rep(NA, length(chats)) - blups[consider] <- c(X_effective%*%beta + us) - mytable$blups <- blups - - if (class(try(getvar(), silent=T)) != "try-error") { - C <- getvar() - blupvars <- rep(NA, length(chats)) - blupvars[consider] <- c(sqrt(diag(cbind(X_effective,diag(1,n))%*%C%*%t(cbind(X_effective,diag(1,n)))))) - mytable$blupses <- blupvars - } - - return(mytable) -} - -#' @export -betta_points <- function(y, se, x=1:length(y), ylimu=NA, myy=NA, mymain=NA, mycol=rep("black", length(y)), labs=NA, mypch=rep(16, length(y)), myxlim=c(0.8*min(x, na.rm=T), 1.2*max(x, na.rm=T))) { - n <- length(y) - #ylimu <- ifelse(is.na(ylimu), max(y+2*se), ylimu) - par(xpd=FALSE) - #plot(0, 0, type="n", xlim=myxlim, ylim=c(0, ylimu), xlab="", bty="n", ylab=myy, main=mymain) - for (i in 1:n) { - if(!is.na(y[i]) & !is.na(x[i])) { - points(x[i], y[i], pch=mypch[i], col=mycol[i]) - lines(c(x[i], x[i]), c(max(0, y[i]-1.96*se[i]), y[i]+1.96*se[i]), col=mycol[i]) - } - } - # if(!is.na(labs)) axis(1, at=1:length(y), labels=labs, las=2, cex=0.8) -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#' modelling total diversity with random effects -#' -#' This function extends betta() to permit random effects modelling. -#' -#' -#' @param chats A vector of estimates of total diversity at different sampling -#' locations. -#' @param ses The standard errors in \samp{chats}, the diversity estimates. -#' @param X A numeric matrix of covariates corresponding to fixed effects. If -#' not supplied, an intercept-only model will be fit. -#' @param groups A categorical variable representing the random-effects groups -#' that each of the estimates belong to. -#' @return \item{table}{ A coefficient table for the model parameters. The -#' columns give the parameter estimates, standard errors, and p-values, -#' respectively. This model is only as effective as your diversity estimation -#' procedure; for this reason please confirm that your estimates are -#' appropriate and that your model is not misspecified. \samp{betta_pic} may be -#' useful for this purpose. } \item{cov}{ Estimated covariance matrix of the -#' parameter estimates. } \item{ssq_u}{ The estimate of the heterogeneity -#' variance. } \item{ssq_g}{ Estimates of within-group variance. The estimate -#' will be zero for groups with only one observation. } \item{homogeneity}{ -#' The test statistic and p-value for the test of homogeneity. } -#' \item{global}{ The test statistic and p-value for the test of model -#' explanatory power. } \item{blups}{ The conditional expected values of the -#' diversity estimates (conditional on the random effects). Estimates of -#' variability for the random effects case are unavailable at this time; please -#' contact the maintainer if needed. } -#' @author Amy Willis -#' @seealso \code{\link{betta}}; \code{\link{betta_pic}} -#' @references Willis, A., Bunge, J., and Whitman, T. (2015). Inference for -#' changes in biodiversity. \emph{arXiv preprint.} -#' @keywords diversity -#' @examples -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), X = cbind(Int = 1, -#' Cont_var = c(100, 150, 100, 50)), groups = c("a", "a", "a", "b")) -#' -#' ## handles missing data -#' betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, NA), groups = c("a", NA, -#' "b", "b")) -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' @export betta_random -betta_random <- function(chats, ses, X=NA, groups) { - if (isTRUE(is.na(X))) { X <- matrix(rep(1,length(chats)),ncol=1) } - consider <- !(is.na(chats) | is.na(ses) | is.na(groups) | apply(is.na(X),1,sum)) - - chats_effective <- chats[consider]; ses_effective <- ses[consider]; X_effective <- as.matrix(X[consider,]) - groups_effective <- groups[consider] - n <- dim(X_effective)[1]; p <- dim(X_effective)[2]; gs <- length(unique(groups_effective)) - - likelihood <- function(input) { - ssq_u <- input[1] - beta <- input[2:(p+1)] - ssq_group <- input[(p+2):(p+gs+1)] - group_variance <- ssq_group[groups_effective] - W <- diag(1/(ssq_u+ses_effective^2+group_variance)) - -0.5*(sum(log(ssq_u+ses_effective^2+group_variance)+(chats_effective-X_effective%*%beta)^2/(ssq_u+ses_effective^2+group_variance)) + log(det(t(X_effective)%*%W%*%X_effective))) - } - - within_groups_start <- c(by(chats_effective, groups_effective, var, simplify = T)) - within_groups_start[which(is.na(within_groups_start))] <- 0 - - mystart <- c(var(chats_effective), - solve(t(X_effective)%*%X_effective)%*%t(X_effective)%*%chats_effective, - within_groups_start) - output <- optim(mystart, likelihood, hessian=FALSE, control=list(fnscale=-1), - lower=c(0, rep(-Inf, p), rep(0, gs)), method="L-BFGS-B") - ssq_u <- output$par[1] - beta <- output$par[2:(p+1)] - ssq_group <- output$par[(p+2):(p+gs+1)] - - W <- diag(1/(ssq_u+ses_effective^2+ssq_group[groups_effective])) - vars <- 1/diag(t(X_effective)%*%W%*%X_effective) - - global <- t(beta)%*%(t(X_effective)%*%W%*%X_effective)%*%beta ## global test - - Q <- sum((chats_effective-X_effective%*%beta)^2/ses_effective^2) - - mytable <- list() - mytable$table <- cbind("Estimates"=beta,"Standard Errors"=sqrt(vars),"p-values"=round(2*(1-pnorm(abs(beta/sqrt(vars)))),3)) - try(rownames(mytable$table) <- colnames(X), silent = T) - mytable$cov <- solve(t(X_effective)%*%W%*%X_effective) - mytable$ssq_u <- ssq_u - mytable$ssq_group <- ssq_group - mytable$homogeneity <- c(Q,1-pchisq(Q,n-p)) - mytable$global <- c(global,1-pchisq(global,p-1)) - - us <- c(ssq_u*W%*%(chats_effective-X_effective%*%beta)) - blups <- rep(NA, length(chats)) - blups[consider] <- c(X_effective%*%beta + us) - mytable$blups <- blups - - return(mytable) -} diff --git a/R/model_betta.R b/R/model_betta.R index f7048c4..654f9e5 100644 --- a/R/model_betta.R +++ b/R/model_betta.R @@ -47,6 +47,9 @@ #' authors believe this to be the first attempt at modelling total diversity in #' a way that accounts for its estimated nature. #' @author Amy Willis +#' +#' @importFrom stats coef dexp dgeom dnbinom dpois fitted lm model.matrix nls optim pchisq pnorm predict quantile rbeta rbinom rnbinom rnorm runif sd var vcov +#' #' @seealso \code{\link{breakaway}}; \code{\link{breakaway_nof1}}; #' \code{\link{apples}} #' @references Willis, A., Bunge, J., and Whitman, T. (2015). Inference for @@ -202,33 +205,14 @@ betta <- function(chats, ses, X=NA) { #' variability for the random effects case are unavailable at this time; please #' contact the maintainer if needed. } #' @author Amy Willis +#' +#' @importFrom stats coef dexp dgeom dnbinom dpois fitted lm model.matrix nls optim pchisq pnorm predict quantile rbeta rbinom rnbinom rnorm runif sd var vcov #' @seealso \code{\link{betta}}; #' @references Willis, A., Bunge, J., and Whitman, T. (2015). Inference for #' changes in biodiversity. \emph{arXiv preprint.} #' @keywords diversity #' @examples #' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' #' betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), X = cbind(Int = 1, #' Cont_var = c(100, 150, 100, 50)), groups = c("a", "a", "a", "b")) #' @@ -236,27 +220,6 @@ betta <- function(chats, ses, X=NA) { #' betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, NA), groups = c("a", NA, #' "b", "b")) #' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' #' @export betta_random betta_random <- function(chats, ses, X=NA, groups) { if (isTRUE(is.na(X))) { X <- matrix(rep(1,length(chats)),ncol=1) } diff --git a/R/richness_breakaway.R b/R/richness_breakaway.R index e97cd2f..6969ab8 100644 --- a/R/richness_breakaway.R +++ b/R/richness_breakaway.R @@ -26,6 +26,7 @@ #' @import magrittr #' @import ggplot2 #' @import phyloseq +#' @importFrom stats coef dexp dgeom dnbinom dpois fitted lm model.matrix nls optim pchisq pnorm predict quantile rbeta rbinom rnbinom rnorm runif sd var vcov #' #' @seealso \code{\link{breakaway_nof1}}; \code{\link{kemp}}; \code{\link{apples}} #' diff --git a/R/richness_chao.Rzzzz b/R/richness_chao.Rzzzz deleted file mode 100644 index 6c08711..0000000 --- a/R/richness_chao.Rzzzz +++ /dev/null @@ -1,518 +0,0 @@ -#' Chao-Bunge species richness estimator -#' -#' This function implements the species richness estimation procedure outlined -#' in Chao & Bunge (2002). -#' -#' -#' @param data The sample frequency count table for the population of interest. -#' See dataset apples for sample formatting. -#' @param cutoff The maximum frequency to use in fitting. -#' @param output Logical: whether the results should be printed to screen. -#' @param answers Should the answers be returned as a list? -#' @return The results of the estimator, including standard error. -#' @author Amy Willis -#' @examples -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' chao_bunge(apples) -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' @export chao_bunge -chao_bunge <- function(my_data, cutoff=10, output=TRUE, answers=FALSE) { - - my_data <- check_format(my_data) - input_data <- my_data - cc <- sum(input_data[,2]) - - index <- 1:max(my_data[,1]) - frequency_index <- rep(0, length(index)) - frequency_index[my_data[,1]] <- my_data[,2] - f1 <- frequency_index[1] - n <- sum(frequency_index) - - if (min(my_data[, 1]) > cutoff) { - warning("cutoff exceeds minimum frequency count index; setting to maximum") - cutoff <- max(my_data[, 1]) - } - my_data <- my_data[ my_data[,1] <= cutoff, ] - cutoff <- max(my_data[,1]) - - d_a <- sum(input_data[input_data[,1] > cutoff, 2]) - k <- 2:cutoff - m <- 1:cutoff - numerator <- frequency_index[k] - denominator <- 1 - f1*sum(m^ 2*frequency_index[m])/(sum(m*frequency_index[m]))^2 # - diversity <- d_a + sum(numerator /denominator) - - f0 <- diversity - cc - - if (diversity >= 0) { - fs_up_to_cut_off <- frequency_index[m] - n_tau <- sum(m * fs_up_to_cut_off) - s_tau <- sum(fs_up_to_cut_off) - H <- sum(m^2 * fs_up_to_cut_off) - derivatives <- n_tau * (n_tau^3 + f1 * n_tau * m^2 * - s_tau - n_tau * f1 * H - f1^2 * n_tau * m^2 - 2 * - f1 * H * m * s_tau + 2 * f1^2 * H * m)/(n_tau^2 - - f1 * H)^2 - derivatives[1] <- n_tau * (s_tau - f1) * (f1 * n_tau - - 2 * f1 * H + n_tau * H)/(n_tau^2 - f1 * H)^2 - covariance <- diag(rep(0, cutoff)) - for (i in 1:(cutoff - 1)) { - covariance[i, (i + 1):cutoff] <- -fs_up_to_cut_off[i] * fs_up_to_cut_off[(i + - 1):cutoff]/diversity - } - covariance <- t(covariance) + covariance - diag(covariance) <- fs_up_to_cut_off * (1 - fs_up_to_cut_off/diversity) - diversity_se <- sqrt(derivatives %*% covariance %*% derivatives) - - } else { - wlrm <- wlrm_untransformed(input_data, print = F, answers = T) - if (is.null(wlrm$est)) { - wlrm <- wlrm_transformed(input_data, print = F, answers = T) - } - diversity <- wlrm$est - diversity_se <- wlrm$seest - f0 <- diversity - sum(frequency_index) - } - - if(output) { - cat("################## Chao-Bunge ##################\n") - cat("\tThe estimate of total diversity is", round(diversity), - "\n \t with std error",round(diversity_se),"\n") - } - if(answers) { - result <- list() - result$name <- "Chao-Bunge" - result$est <- diversity - result$seest <- as.vector(diversity_se) - d <- exp(1.96*sqrt(log(1+result$seest^2/f0))) - result$ci <- c(n+f0/d,n+f0*d) - return(result) - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#' Chao1 species richness estimator -#' -#' This function implements the Chao1 richness estimate, which is often -#' mistakenly referred to as an index. -#' -#' -#' @param data The sample frequency count table for the population of interest. -#' See dataset apples for sample formatting. -#' @param output Logical: whether the results should be printed to screen. -#' @param answers Should the answers be returned as a list? -#' @return The results of the estimator, including standard error. -#' @note The authors of this package strongly discourage the use of this -#' estimator. It is only valid when you wish to assume that every taxa has -#' equal probability of being observed. You don't really think that's possible, -#' do you? -#' @author Amy Willis -#' @examples -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' chao1(apples) -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' @export chao1 -chao1 <- function(data, output=TRUE, answers=FALSE) { - - if( !(is.matrix(data) || is.data.frame(data))) { - filename <- data - ext <- substr(filename, nchar(filename)-2, nchar(filename)) - if (ext == "csv") { - data <- read.table(file=filename, header=0,sep=",") - if( data[1,1] !=1) data <- read.table(filename, header=1,sep=",") - } else if (ext == "txt") { - data <- read.table(file=filename, header=0) - } else cat("Please input your data as a txt or csv file, - or as an R dataframe or matrix.") - } - - if ( is.factor(data[,1]) ) { - fs <- as.numeric(as.character(data[,1])) - data <- cbind(fs,data[,2]) - data <- data[data[,1]!=0,] - } - - index <- 1:max(data[,1]) - frequency_index <- rep(0, length(index)) - frequency_index[data[,1]] <- data[,2] - f1 <- frequency_index[1] - f2 <- frequency_index[2] - n <- sum(frequency_index) - - f0 <- f1^2/(2*f2) - diversity <- n + f0 - - diversity_se <- sqrt(f2*(0.5*(f1/f2)^2 + (f1/f2)^3 + 0.25*(f1/f2)^4)) - - if(output) { - cat("################## Chao1 ##################\n") - cat("\tThe estimate of total diversity is", round(diversity), - "\n \t with std error",round(diversity_se),"\n") - cat("You know that this estimate is only valid if all taxa are equally abundant, right?\n") - } - if(answers) { - result <- list() - result$name <- "Chao1" - result$est <- diversity - result$seest <- diversity_se - d <- exp(1.96*sqrt(log(1+result$seest^2/f0))) - result$ci <- c(n+f0/d,n+f0*d) - return(result) - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#' Bias-corrected Chao1 species richness estimator -#' -#' This function implements the bias-corrected Chao1 richness estimate. -#' -#' -#' @param data The sample frequency count table for the population of interest. -#' See dataset apples for sample formatting. -#' @param output Logical: whether the results should be printed to screen. -#' @param answers Should the answers be returned as a list? -#' @return The results of the estimator, including standard error. -#' @note The authors of this package strongly discourage the use of this -#' estimator. It is underpinned by totally implausible assumptions that are not -#' made by other richness estimators. Bias correcting Chao1 is the least of -#' your problems. -#' @author Amy Willis -#' @examples -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' chao1_bc(apples) -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' -#' @export chao1_bc -chao1_bc <- function(data, output=TRUE, answers=FALSE) { - - if( !(is.matrix(data) || is.data.frame(data))) { - filename <- data - ext <- substr(filename, nchar(filename)-2, nchar(filename)) - if (ext == "csv") { - data <- read.table(file=filename, header=0,sep=",") - if( data[1,1] !=1) data <- read.table(filename, header=1,sep=",") - } else if (ext == "txt") { - data <- read.table(file=filename, header=0) - } else cat("Please input your data as a txt or csv file, - or as an R dataframe or matrix.") - } - - if ( is.factor(data[,1]) ) { - fs <- as.numeric(as.character(data[,1])) - data <- cbind(fs,data[,2]) - data <- data[data[,1]!=0,] - } - - - - index <- 1:max(data[,1]) - frequency_index <- rep(0, length(index)) - frequency_index[data[,1]] <- data[,2] - f1 <- frequency_index[1] - f2 <- frequency_index[2] - n <- sum(frequency_index) - - f0 <- f1*(f1-1)/(2*(f2+1)) - diversity <- n + f0 - - diversity_se <- sqrt(f1*(f1-1)/(2*(f2+1)) + f1*(2*f1-1)^2/(4*(f2+1)^2) + f1^2*f2*(f1-1)^2/(4*(f2+1)^4)) - - if(output) { - cat("################## Bias-corrected Chao1 ##################\n") - cat("\tThe estimate of total diversity is", round(diversity), - "\n \t with std error",round(diversity_se),"\n") - } - if(answers) { - result <- list() - result$name <- "Chao1_bc" - result$est <- diversity - result$seest <- diversity_se - d <- exp(1.96*sqrt(log(1+result$seest^2/f0))) - result$ci <- c(n+f0/d,n+f0*d) - return(result) - } -} - -#' @export chao_shen -chao_shen <- function(my_data) { - - cleaned_data <- check_format(my_data) - - if (cleaned_data[1,1]!=1 || cleaned_data[1,2]==0) { - warning("You don't have an observed singleton count.\n Chao-Shen isn't built for that data structure.\n") - } - - estimate <- chao_shen_estimate(cleaned_data) - cc <- sum(cleaned_data[, 2]) - - j_max <- length(cleaned_data[, 2]) - - derivative <- vector("numeric", j_max) - for (i in 1:j_max) { - perturbed_table <- cleaned_data - perturbed_table[i, 2] <- perturbed_table[i, 2] + 1 - upper <- chao_shen_estimate(perturbed_table) - perturbed_table[i, 2] <- perturbed_table[i, 2] - 2 - lower <- chao_shen_estimate(perturbed_table) - derivative[i] <- (upper - lower)/2 - } - - variance_estimate <- t(derivative) %*% multinomial_covariance(cleaned_data, cc/estimate) %*% derivative - - list("est" = estimate, - "se" = c(ifelse(variance_estimate < 0, 0, sqrt(variance_estimate)))) -} - -chao_shen_estimate <- function(cleaned_data) { - n <- sum(cleaned_data[, 2] * cleaned_data[, 1]) - f1 <- ifelse(cleaned_data[1,1] == 1, cleaned_data[1,2], 0) - - p_hat <- to_proportions(cleaned_data, type="frequency count") - chat <- 1 - f1/n - p_tilde <- chat * p_hat - - -sum(p_tilde * log(p_tilde) / (1 - (1 - p_tilde)^n)) - -} - -multinomial_covariance <- function(my_data, chat) { - frequencies <- my_data[, 2] - j_max <- length(frequencies) - - # divide diagonal by 2 so that when we make it symmetric we don't double count - estimated_covariance <- diag(frequencies*(1 - frequencies / chat) / 2) - - for (i in 1:(j_max-1)) { - estimated_covariance[i, (i + 1):j_max] <- -frequencies[i]*frequencies[(i + 1):j_max]/chat - } - - estimated_covariance + t(estimated_covariance) - -} - - - -#' @export good_turing -good_turing <- function(my_data) { - - cleaned_data <- check_format(my_data) - - if (cleaned_data[1,1]!=1 || cleaned_data[1,2]==0) { - warning("You don't have an observed singleton count.\n Chao-Shen isn't built for that data structure.\n") - } - - cc <- sum(cleaned_data[, 2]) - n <- sum(cleaned_data[, 2] * cleaned_data[, 1]) - f1 <- ifelse(cleaned_data[1,1] == 1, cleaned_data[1,2], 0) - - chat <- cc / (1 - f1/n) - list("est" = chat, - "se" = NA) -} diff --git a/R/richness_wlrm_t.R b/R/richness_wlrm_t.R index 055c575..634c9c8 100644 --- a/R/richness_wlrm_t.R +++ b/R/richness_wlrm_t.R @@ -23,6 +23,7 @@ #' @keywords diversity models #' #' @import ggplot2 +#' @import stats #' #' @examples #' diff --git a/R/richness_wlrm_ut.R b/R/richness_wlrm_ut.R index 439c2a0..f7ce54e 100644 --- a/R/richness_wlrm_ut.R +++ b/R/richness_wlrm_ut.R @@ -25,7 +25,8 @@ #' @importFrom graphics legend points #' @importFrom utils head read.table #' -#' @import ggplot2 +#' @import ggplot2 +#' @import stats #' #' @examples #' diff --git a/build-test-breakaway.R b/build-test-breakaway.R deleted file mode 100644 index 1f5c129..0000000 --- a/build-test-breakaway.R +++ /dev/null @@ -1,46 +0,0 @@ -# useful commands for developers: testing and compiling breakaway - -# Open project - -# directory <- "/Users/adwillis/software/breakaway" -# directory <- "/Users/adw96/Documents/software/breakaway" -directory <- "/Users/amy/Documents/software/breakaway" -setwd(directory) -library(devtools) -library(roxygen2) -library(knitr) -library(rstudioapi) -library(Rd2roxygen) -# install_github("r-lib/fs") -# devtools::install_github("r-lib/pkgdown") -# devtools::install_github("r-lib/testthat") -# devtools::install_github("HenrikBengtsson/R.rsp") -library(fs) -library(pkgdown) -library(testthat) -library(R.rsp) -library(covr) -library(magrittr) -library(ggplot2) -library(tibble) - - -check() -document() -roxygenise() -build(vignettes = F) -library(breakaway) - -library(phyloseq) -data("GlobalPatterns") -phyloseq::plot_richness(GlobalPatterns, x="SampleType", color="SampleType") - -test(directory) - -cov <- covr::package_coverage() -plot(cov) -zero_coverage(cov) - -# rmarkdown::render("README.Rmd") -# pkgdown::build_site() - diff --git a/docs/TODO.html b/docs/TODO.html index 30c174e..7f77848 100644 --- a/docs/TODO.html +++ b/docs/TODO.html @@ -61,7 +61,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/articles/breakaway.html b/docs/articles/breakaway.html index 87c4f93..787872c 100644 --- a/docs/articles/breakaway.html +++ b/docs/articles/breakaway.html @@ -30,7 +30,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/articles/extended-tutorial.html b/docs/articles/extended-tutorial.html index 29d99c8..e940848 100644 --- a/docs/articles/extended-tutorial.html +++ b/docs/articles/extended-tutorial.html @@ -30,7 +30,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/articles/index.html b/docs/articles/index.html index 3083a53..1ac52c4 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -61,11 +61,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/articles/resample-estimates.html b/docs/articles/resample-estimates.html index eb0b416..6a57741 100644 --- a/docs/articles/resample-estimates.html +++ b/docs/articles/resample-estimates.html @@ -30,7 +30,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/articles/sample-size-calculations.html b/docs/articles/sample-size-calculations.html index 77313db..dc0aa62 100644 --- a/docs/articles/sample-size-calculations.html +++ b/docs/articles/sample-size-calculations.html @@ -30,7 +30,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/index.html b/docs/index.html index 3147a5e..b936519 100644 --- a/docs/index.html +++ b/docs/index.html @@ -97,11 +97,11 @@

The R package breakaway implements a number of different richness estimates. Please cite the following if you use them:

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 6f61e1d..887c604 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,15 +1,11 @@ pandoc: 1.17.2 pkgdown: 1.1.0.9000 pkgdown_sha: b2798656f04ce282edea3e12734ba5588c6acd6e -<<<<<<< Updated upstream articles: breakaway: breakaway.html extended-tutorial: extended-tutorial.html resample-estimates: resample-estimates.html sample-size-calculations: sample-size-calculations.html -======= -articles: [] ->>>>>>> Stashed changes urls: reference: http://adw96.github.io/breakaway/reference article: http://adw96.github.io/breakaway/articles diff --git a/docs/reference/alpha_estimate.html b/docs/reference/alpha_estimate.html index 9af6b22..1ae0027 100644 --- a/docs/reference/alpha_estimate.html +++ b/docs/reference/alpha_estimate.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/alpha_estimates.html b/docs/reference/alpha_estimates.html index 2c32a45..506f071 100644 --- a/docs/reference/alpha_estimates.html +++ b/docs/reference/alpha_estimates.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/apples.html b/docs/reference/apples.html index 7d1cce6..66f510c 100644 --- a/docs/reference/apples.html +++ b/docs/reference/apples.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/betta.html b/docs/reference/betta.html index 18735f3..ac33d03 100644 --- a/docs/reference/betta.html +++ b/docs/reference/betta.html @@ -66,11 +66,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -190,7 +186,7 @@

Note

important role in explaining the subtleties of the ecosystem, however, a regression analysis on the observed diversity level fails to account for these unobserved taxa. By predicting the total level of diversity (for -example, via breakaway) and estimating the standard error in +example, via breakaway) and estimating the standard error in the estimate, one can take account of these unobserved, but important, taxa. In order to account for the estimated nature of the response, a mixed model approach is taken, whereby the varying levels of confidence in the estimates @@ -210,8 +206,8 @@

R

See also

-

breakaway; breakaway_nof1; -apples

+

breakaway; breakaway_nof1; +apples

Examples

diff --git a/docs/reference/betta_pic.html b/docs/reference/betta_pic.html index bdb3fec..9d3eb8d 100644 --- a/docs/reference/betta_pic.html +++ b/docs/reference/betta_pic.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -192,7 +188,7 @@

R

See also

-

betta

+

betta

Examples

diff --git a/docs/reference/betta_random.html b/docs/reference/betta_random.html index c25e492..5f6a527 100644 --- a/docs/reference/betta_random.html +++ b/docs/reference/betta_random.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -183,32 +179,11 @@

R

See also

-

betta;

+

betta;

Examples

- - - - - - - - - - - - - - - - - - - - - betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), X = cbind(Int = 1, Cont_var = c(100, 150, 100, 50)), groups = c("a", "a", "a", "b"))
#> $table #> Estimates Standard Errors p-values @@ -264,27 +239,6 @@

Examp #> $blups #> [1] 2004.975 NA 3988.875 NA #>

- - - - - - - - - - - - - - - - - - - - -
@@ -140,7 +136,7 @@

Arg input_data -

An input type that can be processed by convert()

+

An input type that can be processed by convert()

output @@ -175,7 +171,7 @@

Note

diversity attributable to sequencing errors (via an inflated singleton count). The authors encourage judicious use of diversity estimators when the dataset may contain these errors, and recommend the use of -breakaway_nof1 as an exploratory tool in this case.

+breakaway_nof1 as an exploratory tool in this case.

References

@@ -184,11 +180,7 @@

R

See also

-<<<<<<< Updated upstream

breakaway_nof1; kemp; apples

-======= -

breakaway_nof1; kemp; apples

->>>>>>> Stashed changes

Examples

diff --git a/docs/reference/breakaway_nof1.html b/docs/reference/breakaway_nof1.html index f6792fe..2c5e2f4 100644 --- a/docs/reference/breakaway_nof1.html +++ b/docs/reference/breakaway_nof1.html @@ -70,11 +70,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -134,11 +130,11 @@

species richness estimation without singletons

This function permits estimation of total diversity based on a sample -frequency count table. Unlike breakaway, it does not require +frequency count table. Unlike breakaway, it does not require an input for the number of species observed once, making it an excellent exploratory tool for microbial ecologists who believe that their sample may contain spurious singletons. The underlying estimation procedure is similar -to that of breakaway and is outlined in Willis & Bunge (2014). +to that of breakaway and is outlined in Willis & Bunge (2014). The diversity estimate, standard error, estimated model coefficients and plot of the fitted model are returned.

@@ -152,7 +148,7 @@

Arg input_data -

An input type that can be processed by convert()

+

An input type that can be processed by convert()

output @@ -217,7 +213,7 @@

R

See also

-

breakaway; apples

+

Examples

diff --git a/docs/reference/build_frequency_count_tables.html b/docs/reference/build_frequency_count_tables.html index d714781..b76c7f7 100644 --- a/docs/reference/build_frequency_count_tables.html +++ b/docs/reference/build_frequency_count_tables.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes
diff --git a/docs/reference/chao1.html b/docs/reference/chao1.html index bf97c3e..e5a28ab 100644 --- a/docs/reference/chao1.html +++ b/docs/reference/chao1.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -139,11 +135,7 @@

Arg input_data -<<<<<<< Updated upstream

An input type that can be processed by convert() or a phyloseq object

-======= -

An input type that can be processed by convert() or a phyloseq object

->>>>>>> Stashed changes output diff --git a/docs/reference/chao1_bc.html b/docs/reference/chao1_bc.html index eba9a82..4304089 100644 --- a/docs/reference/chao1_bc.html +++ b/docs/reference/chao1_bc.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -137,11 +133,7 @@

Arg input_data -<<<<<<< Updated upstream

An input type that can be processed by convert() or a phyloseq object

-======= -

An input type that can be processed by convert() or a phyloseq object

->>>>>>> Stashed changes output diff --git a/docs/reference/chao_bunge.html b/docs/reference/chao_bunge.html index cf3dc6b..55c05bf 100644 --- a/docs/reference/chao_bunge.html +++ b/docs/reference/chao_bunge.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -139,11 +135,7 @@

Arg input_data -<<<<<<< Updated upstream

An input type that can be processed by convert() or a phyloseq object

-======= -

An input type that can be processed by convert() or a phyloseq object

->>>>>>> Stashed changes cutoff diff --git a/docs/reference/chao_shen.html b/docs/reference/chao_shen.html index 8dc146a..8eab537 100644 --- a/docs/reference/chao_shen.html +++ b/docs/reference/chao_shen.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/check_format.html b/docs/reference/check_format.html index b9c94ce..5bd0805 100644 --- a/docs/reference/check_format.html +++ b/docs/reference/check_format.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/convert.html b/docs/reference/convert.html index 0ec4d95..c89c0ef 100644 --- a/docs/reference/convert.html +++ b/docs/reference/convert.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/cutoff_wrap.html b/docs/reference/cutoff_wrap.html index ca32cf1..3e209ca 100644 --- a/docs/reference/cutoff_wrap.html +++ b/docs/reference/cutoff_wrap.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/good_turing.html b/docs/reference/good_turing.html index 540e569..6f45855 100644 --- a/docs/reference/good_turing.html +++ b/docs/reference/good_turing.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/hawaii.html b/docs/reference/hawaii.html index 8f03f0b..8561832 100644 --- a/docs/reference/hawaii.html +++ b/docs/reference/hawaii.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/index.html b/docs/reference/index.html index b00ffb1..54b58c4 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -61,11 +61,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/kemp.html b/docs/reference/kemp.html index ae7116b..8155305 100644 --- a/docs/reference/kemp.html +++ b/docs/reference/kemp.html @@ -65,7 +65,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/make_design_matrix.html b/docs/reference/make_design_matrix.html index 9c5ba01..9e61dd9 100644 --- a/docs/reference/make_design_matrix.html +++ b/docs/reference/make_design_matrix.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/make_frequency_count_table.html b/docs/reference/make_frequency_count_table.html index cc00225..ee46ad9 100644 --- a/docs/reference/make_frequency_count_table.html +++ b/docs/reference/make_frequency_count_table.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/objective_bayes_geometric.html b/docs/reference/objective_bayes_geometric.html index 842f285..c52de15 100644 --- a/docs/reference/objective_bayes_geometric.html +++ b/docs/reference/objective_bayes_geometric.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/objective_bayes_mixedgeo.html b/docs/reference/objective_bayes_mixedgeo.html index f1d3a1e..7a155b8 100644 --- a/docs/reference/objective_bayes_mixedgeo.html +++ b/docs/reference/objective_bayes_mixedgeo.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/objective_bayes_negbin.html b/docs/reference/objective_bayes_negbin.html index e4932f0..036ae67 100644 --- a/docs/reference/objective_bayes_negbin.html +++ b/docs/reference/objective_bayes_negbin.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/objective_bayes_poisson.html b/docs/reference/objective_bayes_poisson.html index 7b78bab..fe44b5e 100644 --- a/docs/reference/objective_bayes_poisson.html +++ b/docs/reference/objective_bayes_poisson.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/physeq_wrap.html b/docs/reference/physeq_wrap.html index 61f009f..dc6992d 100644 --- a/docs/reference/physeq_wrap.html +++ b/docs/reference/physeq_wrap.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/plot.alpha_estimates.html b/docs/reference/plot.alpha_estimates.html index 194e56a..d59e1f0 100644 --- a/docs/reference/plot.alpha_estimates.html +++ b/docs/reference/plot.alpha_estimates.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/proportions_instead.html b/docs/reference/proportions_instead.html index e3044d2..f7321e9 100644 --- a/docs/reference/proportions_instead.html +++ b/docs/reference/proportions_instead.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/rnbinomtable.html b/docs/reference/rnbinomtable.html index 6d4cfbb..935a907 100644 --- a/docs/reference/rnbinomtable.html +++ b/docs/reference/rnbinomtable.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/rztnbinomtable.html b/docs/reference/rztnbinomtable.html index e8dbe9e..35189a1 100644 --- a/docs/reference/rztnbinomtable.html +++ b/docs/reference/rztnbinomtable.html @@ -66,11 +66,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/sample_inverse_simpson.html b/docs/reference/sample_inverse_simpson.html index 6a21077..9bc1769 100644 --- a/docs/reference/sample_inverse_simpson.html +++ b/docs/reference/sample_inverse_simpson.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/sample_richness.html b/docs/reference/sample_richness.html index 8808e86..f7b596f 100644 --- a/docs/reference/sample_richness.html +++ b/docs/reference/sample_richness.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/sample_shannon.html b/docs/reference/sample_shannon.html index c0e6241..1f01709 100644 --- a/docs/reference/sample_shannon.html +++ b/docs/reference/sample_shannon.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/sample_shannon_e.html b/docs/reference/sample_shannon_e.html index 6fbb724..a7e4b24 100644 --- a/docs/reference/sample_shannon_e.html +++ b/docs/reference/sample_shannon_e.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/sample_simpson.html b/docs/reference/sample_simpson.html index 36bb544..8191351 100644 --- a/docs/reference/sample_simpson.html +++ b/docs/reference/sample_simpson.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/sample_size_estimate.html b/docs/reference/sample_size_estimate.html index 7c3bd10..c8a14e2 100644 --- a/docs/reference/sample_size_estimate.html +++ b/docs/reference/sample_size_estimate.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/sample_size_figure.html b/docs/reference/sample_size_figure.html index e1663e1..0f293f4 100644 --- a/docs/reference/sample_size_figure.html +++ b/docs/reference/sample_size_figure.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/toy_metadata.html b/docs/reference/toy_metadata.html index 08a4fbb..763478c 100644 --- a/docs/reference/toy_metadata.html +++ b/docs/reference/toy_metadata.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/toy_otu_table.html b/docs/reference/toy_otu_table.html index d64b712..a2331e8 100644 --- a/docs/reference/toy_otu_table.html +++ b/docs/reference/toy_otu_table.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/toy_taxonomy.html b/docs/reference/toy_taxonomy.html index 1ddf674..8290b12 100644 --- a/docs/reference/toy_taxonomy.html +++ b/docs/reference/toy_taxonomy.html @@ -63,11 +63,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes diff --git a/docs/reference/true_gini.html b/docs/reference/true_gini.html index 6cb2332..62638b0 100644 --- a/docs/reference/true_gini.html +++ b/docs/reference/true_gini.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/true_hill.html b/docs/reference/true_hill.html index c3da053..d4dab4b 100644 --- a/docs/reference/true_hill.html +++ b/docs/reference/true_hill.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/true_inverse_simpson.html b/docs/reference/true_inverse_simpson.html index a4364fa..b5eca67 100644 --- a/docs/reference/true_inverse_simpson.html +++ b/docs/reference/true_inverse_simpson.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/true_shannon.html b/docs/reference/true_shannon.html index 62412bd..659efae 100644 --- a/docs/reference/true_shannon.html +++ b/docs/reference/true_shannon.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/true_shannon_e.html b/docs/reference/true_shannon_e.html index 267e319..b083742 100644 --- a/docs/reference/true_shannon_e.html +++ b/docs/reference/true_shannon_e.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/true_simpson.html b/docs/reference/true_simpson.html index ea8aa0f..10c1580 100644 --- a/docs/reference/true_simpson.html +++ b/docs/reference/true_simpson.html @@ -63,7 +63,7 @@ breakaway - 4.6.2 + 4.6.3 diff --git a/docs/reference/wlrm_transformed.html b/docs/reference/wlrm_transformed.html index 8f4496f..262805d 100644 --- a/docs/reference/wlrm_transformed.html +++ b/docs/reference/wlrm_transformed.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -140,11 +136,7 @@

Arg input_data -<<<<<<< Updated upstream

An input type that can be processed by convert() or a phyloseq object

-======= -

An input type that can be processed by convert() or a phyloseq object

->>>>>>> Stashed changes cutoff @@ -182,8 +174,8 @@

R

See also

-

breakaway; apples; -wlrm_untransformed

+

breakaway; apples; +wlrm_untransformed

Examples

diff --git a/docs/reference/wlrm_untransformed.html b/docs/reference/wlrm_untransformed.html index b386aac..2212be9 100644 --- a/docs/reference/wlrm_untransformed.html +++ b/docs/reference/wlrm_untransformed.html @@ -64,11 +64,7 @@ breakaway -<<<<<<< Updated upstream - 4.6.2 -======= 4.6.3 ->>>>>>> Stashed changes @@ -140,11 +136,7 @@

Arg input_data -<<<<<<< Updated upstream

An input type that can be processed by convert() or a phyloseq object

-======= -

An input type that can be processed by convert() or a phyloseq object

->>>>>>> Stashed changes cutoff @@ -182,8 +174,8 @@

R

See also

-

breakaway; apples; -wlrm_transformed

+

breakaway; apples; +wlrm_transformed

Examples

diff --git a/man/betta_random.Rd b/man/betta_random.Rd index 2e4d28e..ab98a72 100644 --- a/man/betta_random.Rd +++ b/man/betta_random.Rd @@ -40,27 +40,6 @@ This function extends betta() to permit random effects modelling. } \examples{ - - - - - - - - - - - - - - - - - - - - - betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), X = cbind(Int = 1, Cont_var = c(100, 150, 100, 50)), groups = c("a", "a", "a", "b")) @@ -68,27 +47,6 @@ betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, 180), X = cbind(Int = 1 betta_random(c(2000, 3000, 4000, 3000), c(100, 200, 150, NA), groups = c("a", NA, "b", "b")) - - - - - - - - - - - - - - - - - - - - - } \references{ Willis, A., Bunge, J., and Whitman, T. (2015). Inference for