Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed May 25, 2021
1 parent 5c02ebf commit 7af8bec
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 62 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -43,7 +43,7 @@ Description: An easy way to examine archaeological count data. This
visualize count data and statistical thresholds: rank vs abundance
plots, heatmaps, Ford (1962) and Bertin (1977) diagrams.
License: GPL-3
URL: https://packages.tesselle.org/tabula, https://github.com/tesselle/tabula
URL: https://packages.tesselle.org/tabula/, https://github.com/tesselle/tabula
BugReports: https://github.com/tesselle/tabula/issues
Depends:
R (>= 3.3)
Expand Down
52 changes: 23 additions & 29 deletions R/AllClasses.R
Expand Up @@ -8,11 +8,12 @@ setOldClass("dist")
#' Diversity Index
#'
#' An S4 class to represent a diversity measure.
#' @slot data A [`numeric`] matrix of count data.
#' @slot names A [`character`] vector giving the sample names.
#' @slot values A [`numeric`] vector giving the diversity index values.
#' @slot size A [`integer`] vector giving the sample sizes.
#' @slot simulation A [`numeric`] matrix giving the diversity measures for the
#' simulated assemblage.
#' @slot simulation A four columns [`numeric`] matrix giving the diversity
#' measures for the simulated assemblage (sample `size`, `mean` estimate,
#' `lower` and `upper` boundaries of the confidence interval).
#' @slot method A [`character`] string specifying the method used.
#' @section Subset:
#' In the code snippets below, `x` is a `DiversityIndex` object.
Expand Down Expand Up @@ -76,37 +77,30 @@ NULL
#' Partial Bootstrap CA
#'
#' An S4 class to store partial bootstrap correspondence analysis results.
#' @slot row_chull A list of length three giving the vertices coordinates
#' (`x`, `y`) of the samples convex hull and a identifier
#' (\code{id}) to link each row to a sample.
#' @slot column_chull A list of length three giving the vertices coordinates
#' (`x`, `y`) of the variables convex hull and a identifier
#' (\code{id}) to link each row to a variable.
#' @slot row_lengths A list of two named [`numeric`] vectors giving the
#' convex hull maximum dimension length of samples and variables, respectively.
#' @slot column_lengths A list of two named [`numeric`] vectors giving the
#' convex hull maximum dimension length of samples and variables, respectively.
#' @slot cutoff A length-two [`numeric`] vector giving the cutoff
#' value for samples and variables selection, respectively.
#' @slot keep A list of two [`integer`] vectors giving the subscript
#' of the samples and variables to be kept, respectively.
#' @slot row_chull A three columns [`numeric`] matrix giving the vertices
#' coordinates (`x`, `y`) of the samples convex hull and a identifier (`id`) to
#' link each row to a sample.
#' @slot row_lengths A named [`numeric`] vector giving the convex hull maximum
#' dimension length of samples.
#' @slot row_keep An [`integer`] vector giving the subscript of the samples to
#' be kept.
#' @slot column_chull A three columns [`numeric`] matrix giving the vertices
#' coordinates (`x`, `y`) of the variables convex hull and a identifier (`id`)
#' to link each row to a variable.
#' @slot column_lengths A [`numeric`] vector giving the convex hull maximum
#' dimension length of variables.
#' @slot column_keep An [`integer`] vector giving the subscript of the variables
#' to be kept.
#' @slot cutoff A length-two [`numeric`] vector giving the cutoff value for
#' samples and variables selection, respectively.
#' @section Subset:
#' In the code snippets below, `x` is a `RefineCA` object.
#' \describe{
#' \item{\code{x[i, j, drop]}}{Extracts information from a slot selected by
#' subscript `i` thru `j` (see examples). `i` should be one of
#' "\code{rows}" or "\code{columns}". Any unambiguous substring can be
#' given. `j` is a [`numeric`], [`integer`] or
#' [`character`] vector or empty (missing) or `NULL`.
#' Numeric values are coerced to [`integer`] as by
#' [as.integer()] (and hence truncated towards zero). Character
#' vectors will be matched to the name of the elements. An empty index
#' (a comma separated blank) indicates that all entries in that dimension are
#' selected.}
#' \item{`x[[i]]`}{Extracts information from a slot selected by subscript `i`.
#' `i` is a length-one [`character`] vector. Returns the corresponding slot
#' values.}
#' }
#' @seealso [`dimensio::CA-class`]
#' @author N. Frerebeau
#' @family class
#' @docType class
Expand All @@ -116,10 +110,10 @@ NULL
slots = c(
row_chull = "matrix",
row_length = "numeric",
row_keep = "numeric",
row_keep = "integer",
column_chull = "matrix",
column_length = "numeric",
column_keep = "numeric",
column_keep = "integer",
cutoff = "numeric"
),
contains = "CA"
Expand Down
2 changes: 1 addition & 1 deletion R/coerce.R
Expand Up @@ -5,7 +5,7 @@ NULL
# To data.frame ================================================================
#' @method as.data.frame DiversityIndex
#' @export
as.data.frame.DiversityIndex <- function(x, ..., stringsAsFactors = default.stringsAsFactors()) {
as.data.frame.DiversityIndex <- function(x, ...) {
data.frame(
size = x@size,
index = x@values,
Expand Down
3 changes: 2 additions & 1 deletion R/index_diversity.R
Expand Up @@ -127,7 +127,7 @@ simulate_diversity <- function(object, method, quantiles = TRUE,
if (progress_bar) close(pbar)

simulated <- do.call(rbind, simulated)
simulated <- cbind(size = sample_sizes, simulated)
simulated <- cbind(`size` = sample_sizes, simulated)

methods::initialize(index, simulation = simulated)
}
Expand All @@ -148,6 +148,7 @@ simulate_diversity <- function(object, method, quantiles = TRUE,
#' @param na.rm A [`logical`] scalar: should missing values be removed
#' before the quantiles are computed?
#' @param ... Further parameters to be passed to `method`.
#' @return A [`numeric`] vector.
#' @keywords internal
#' @noRd
sim <- function(size, prob, method, n = 1000, level = 0.80,
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Expand Up @@ -10,7 +10,7 @@
"codeRepository": "https://github.com/tesselle/tabula",
"relatedLink": [
"https://CRAN.R-project.org/package=tabula",
"https://packages.tesselle.org/tabula"
"https://packages.tesselle.org/tabula/"
],
"issueTracker": "https://github.com/tesselle/tabula/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
Expand Down Expand Up @@ -297,7 +297,7 @@
}
}
],
"fileSize": "1906.464KB",
"fileSize": "1905.615KB",
"releaseNotes": "https://github.com/tesselle/tabula/blob/master/NEWS.md",
"readme": "https://github.com/tesselle/tabula/blob/master/README.md"
}
7 changes: 4 additions & 3 deletions man/DiversityIndex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 19 additions & 24 deletions man/RefineCA-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tabula-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7af8bec

Please sign in to comment.