Skip to content

Commit

Permalink
Merge pull request #60 from mayer79/docu_fix
Browse files Browse the repository at this point in the history
Clearer documentation of grid arguments
  • Loading branch information
mayer79 authored Sep 16, 2023
2 parents 4850fa3 + 9961f6c commit d7001dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions R/grid.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#' Univariate Grid
#'
#' @description
#' Finds evaluation grid for any numeric or non-numeric vector `z`.
#' Creates evaluation grid for any numeric or non-numeric vector `z`.
#'
#' For discrete `z` (non-numeric, or numeric with at most `grid_size` unique values),
#' this is simply `sort(unique(z))`.
#'
#' Otherwise, if `strategy = "uniform"` (default), the evaluation points form a regular
#' grid over the trimmed range of `z`. By trimmed range we mean the
#' range of `z` after removing values outside the `trim[1]` and `trim[2]` quantiles.
#' range of `z` after removing values outside `trim[1]` and `trim[2]` quantiles.
#' Set `trim = 0:1` for no trimming.
#'
#' If `strategy = "quantile"`, the evaluation points are quantiles over a regular grid
Expand All @@ -20,11 +20,11 @@
#' @param z A vector or factor.
#' @param grid_size Approximate grid size.
#' @param trim The default `c(0.01, 0.99)` means that values outside the
#' 1% and 99% quantile of a non-discrete numeric `z` are removed before calculating
#' the grid values. Set to `0:1` for no trimming.
#' @param strategy How to find evaluation points of non-discrete numeric columns?
#' 1% and 99% quantiles of non-discrete numeric columns are removed before calculation
#' of grid values. Set to `0:1` for no trimming.
#' @param strategy How to find grid values of non-discrete numeric columns?
#' Either "uniform" or "quantile", see description of [univariate_grid()].
#' @returns A vector/factor of evaluation points.
#' @returns A vector or factor of evaluation points.
#' @seealso [multivariate_grid()]
#' @export
#' @examples
Expand Down
4 changes: 2 additions & 2 deletions R/partial_dep.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#'
#' @inheritParams hstats
#' @inheritParams multivariate_grid
#' @param grid A vector (if `length(v) == 1L`), or a matrix/data.frame otherwise.
#' If `NULL`, calculated via [multivariate_grid()].
#' @param grid Evaluation grid. A vector (if `length(v) == 1L`), or a matrix/data.frame
#' otherwise. If `NULL`, calculated via [multivariate_grid()].
#' @param BY Optional grouping vector or a column name. The partial dependence
#' function is calculated per `BY` group. Each `BY` group
#' uses the same evaluation grid to improve assessment of (non-)additivity.
Expand Down
10 changes: 5 additions & 5 deletions man/ice.Rd

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

6 changes: 3 additions & 3 deletions man/multivariate_grid.Rd

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

10 changes: 5 additions & 5 deletions man/partial_dep.Rd

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

12 changes: 6 additions & 6 deletions man/univariate_grid.Rd

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

0 comments on commit d7001dd

Please sign in to comment.