Skip to content

Commit

Permalink
add return roxygen to all exported functions
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed May 22, 2024
1 parent b397df7 commit b63ac3f
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/coerce-vector.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#'
#' The values of `x` must be double or integer. It must not contain any `Inf` or
#' `NaN` values.
#'
#' @return sparse vectors
#'
#' @examples
#' x_dense <- c(3, 0, 2, 0, 0, 0, 4, 0, 0, 0)
Expand Down
6 changes: 6 additions & 0 deletions R/coerce.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#' columns or not. Thus it works with any data frame. Needless to say, creating
#' a sparse matrix out of a dense data frame is not ideal.
#'
#' @return sparse matrix
#'
#' @seealso [coerce_to_sparse_data_frame()] [coerce_to_sparse_tibble()]
#' @examplesIf rlang::is_installed("Matrix")
#' sparse_tbl <- lapply(1:10, function(x) sparse_double(x, x, length = 10))
Expand Down Expand Up @@ -78,6 +80,8 @@ coerce_to_sparse_matrix <- function(x) {
#' @details
#' The only requirement from the sparse matrix is that it contains column names.
#'
#' @return tibble with sparse columns
#'
#' @seealso [coerce_to_sparse_data_frame()] [coerce_to_sparse_matrix()]
#' @examplesIf rlang::is_installed("tibble")
#' set.seed(1234)
Expand Down Expand Up @@ -126,6 +130,8 @@ coerce_to_sparse_tibble <- function(x) {
#' @details
#' The only requirement from the sparse matrix is that it contains column names.
#'
#' @return data.frame with sparse columns
#'
#' @seealso [coerce_to_sparse_tibble()] [coerce_to_sparse_matrix()]
#' @examplesIf rlang::is_installed("Matrix")
#' set.seed(1234)
Expand Down
2 changes: 2 additions & 0 deletions R/extractors.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#' @details
#' for ease of use, these functions also works on non-sparse variables.
#'
#' @return vectors of requested attributes
#'
#' @examples
#' x_sparse <- sparse_double(c(pi, 5, 0.1), c(2, 5, 10), 10)
#' x_dense <- c(0, pi, 0, 0, 0.5, 0, 0, 0, 0, 0.1)
Expand Down
2 changes: 2 additions & 0 deletions R/sparse_character.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#' setting `options("sparsevctrs.verbose_materialize" = TRUE)` will print a
#' message each time a sparse vector has been forced to materialize.
#'
#' @return sparse character vector
#'
#' @seealso [sparse_double()] [sparse_integer()]
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/sparse_double.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#' setting `options("sparsevctrs.verbose_materialize" = TRUE)` will print a
#' message each time a sparse vector has been forced to materialize.
#'
#' @return sparse double vector
#'
#' @seealso [sparse_integer()] [sparse_character()]
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/sparse_integer.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#' setting `options("sparsevctrs.verbose_materialize" = TRUE)` will print a
#' message each time a sparse vector has been forced to materialize.
#'
#' @return sparse integer vector
#'
#' @seealso [sparse_double()] [sparse_character()]
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/sparse_logical.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#' setting `options("sparsevctrs.verbose_materialize" = TRUE)` will print a
#' message each time a sparse vector has been forced to materialize.
#'
#' @return sparse logical vector
#'
#' @seealso [sparse_double()] [sparse_integer()] [sparse_character()]
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/type-predicates.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#' more specific functions that only detects the type. `is_sparse_numeric()`
#' matches both sparse integers and doubles.
#'
#' @return single logical value
#'
#' @examples
#' x_sparse <- sparse_double(c(pi, 5, 0.1), c(2, 5, 10), 10)
#' x_dense <- c(0, pi, 0, 0, 0.5, 0, 0, 0, 0, 0.1)
Expand Down
3 changes: 3 additions & 0 deletions man/coerce-vector.Rd

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

3 changes: 3 additions & 0 deletions man/coerce_to_sparse_data_frame.Rd

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

3 changes: 3 additions & 0 deletions man/coerce_to_sparse_matrix.Rd

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

3 changes: 3 additions & 0 deletions man/coerce_to_sparse_tibble.Rd

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

3 changes: 3 additions & 0 deletions man/extractors.Rd

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

3 changes: 3 additions & 0 deletions man/sparse_character.Rd

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

3 changes: 3 additions & 0 deletions man/sparse_double.Rd

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

3 changes: 3 additions & 0 deletions man/sparse_integer.Rd

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

3 changes: 3 additions & 0 deletions man/sparse_logical.Rd

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

3 changes: 3 additions & 0 deletions man/type-predicates.Rd

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

0 comments on commit b63ac3f

Please sign in to comment.