Skip to content

Commit

Permalink
updated with values added to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonStanley committed Mar 16, 2020
1 parent 66f107e commit 58474ff
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Authors@R: c(
person(given = "Mark",
family = "Fairbanks",
role = "ctb"))
Description: Some tidying functions built on data.table
Description: Tidying functions built on 'data.table'
to provide quick and efficient data manipulation with
minimal overhead.
Imports:
Expand All @@ -26,6 +26,6 @@ Suggests:
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
LinkingTo:
Rcpp
2 changes: 2 additions & 0 deletions R/case_when.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#'
#' @param ... statements of the form: \code{condition ~ label}, where the label is applied if the condition is met
#'
#' @return Vector of the same size as the input vector
#'
#' @import data.table
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/count.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' @param na.rm should any rows with missingness be removed before the count? Default is \code{FALSE}.
#' @param wt the wt assigned to the counts (same number of rows as the data)
#'
#' @return A data.table with counts for each group (or combination of groups)
#'
#' @examples
#'
#' library(data.table)
Expand Down
2 changes: 2 additions & 0 deletions R/fill.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#' @param id the grouping variable(s) to fill within
#' @param .direction either "down" or "up" (down fills values down, up fills values up), or "downup" (down first then up) or "updown" (up first then down)
#'
#' @return A data.table with listed columns having values filled in
#'
#' @examples
#'
#' set.seed(84322)
Expand Down
3 changes: 2 additions & 1 deletion R/nest.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#' @param ... the variables to group by
#' @param .key the name of the list column; default is "data"
#'
#'
#' @examples
#'
#' library(data.table)
Expand All @@ -18,6 +17,8 @@
#'
#' dt_nest(dt, grp)
#'
#' @return A data.table with a list column containing data.tables
#'
#' @import data.table
#'
#' @export
Expand Down
1 change: 1 addition & 0 deletions R/pivot_longer.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @param values_drop_na If TRUE, rows will be dropped that contain NAs.
#' @param ... Additional arguments to pass to `melt.data.table()`
#'
#' @return A reshaped data.table into longer format
#'
#' @examples
#'
Expand Down
2 changes: 2 additions & 0 deletions R/pivot_wider.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#' @param names_sep the separator between the names of the columns
#' @param values_from A pair of arguments describing which column (or columns) to get the name of the output column (\code{name_from}), and which column (or columns) to get the cell values from (\code{values_from}).
#'
#' @return A reshaped data.table into wider format
#'
#' @examples
#'
#' library(data.table)
Expand Down
1 change: 1 addition & 0 deletions R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param nrows total number of rows to print (\code{options("datatable.print.nrows")})
#' @param trunc.cols if \code{TRUE}, only the columns that fit in the console are printed (with a message stating the variables not shown, similar to \code{tibbles}; \code{options("datatable.print.trunc.cols")}). This only works on \code{data.table} versions higher than \code{1.12.6} (i.e. not currently available but anticipating the eventual release).
#'
#' @return None. This function is used for its side effect of changing options.
#'
#' @examples
#'
Expand Down
2 changes: 2 additions & 0 deletions R/select_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#'
#' @param match a character string to match to variable names
#'
#' @return None. To be used within the `dt_pivot_*` functions.
#'
#' @md
#' @examples
#' library(data.table)
Expand Down
3 changes: 3 additions & 0 deletions R/separate.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#' @param immutable If \code{TRUE}, \code{.dt} is treated as immutable (it will not be modified in place). Alternatively, you can set \code{immutable = FALSE} to modify the input object.
#' @param ... arguments passed to \code{data.table::tstrplit()}
#'
#'
#' @return A data.table with a column split into multiple columns.
#'
#' @examples
#'
#' library(data.table)
Expand Down
6 changes: 3 additions & 3 deletions R/uncount.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
#' w = c(2,1,4)
#' )
#' uncount <- dt_uncount(dt_count, w, .id = "id")
#' uncount # note that if .remove = TRUE or .id is not null
#' # this won't print the first time
#' # due to a printing behavior in data.table
#' uncount[] # note that `[]` forces the printing
#'
#'
#' @import data.table
#'
#' @return A data.table with a row for each uncounted column.
#'
#' @export
dt_uncount <- function(dt_, weights, .remove = TRUE, .id = NULL){
UseMethod("dt_uncount", dt_)
Expand Down
3 changes: 3 additions & 0 deletions man/dt_case_when.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/dt_count.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/dt_fill.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/dt_nest.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/dt_pivot_longer.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/dt_pivot_wider.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/dt_print_options.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/dt_separate.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/dt_starts_with.Rd

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

7 changes: 4 additions & 3 deletions man/dt_uncount.Rd

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

0 comments on commit 58474ff

Please sign in to comment.