Skip to content

Commit 1393f96

Browse files
committed
improve descriptors examples
Initially switched from iris to mtcars, but the Orange data is a bit more interesting / illustrative.
1 parent 6dc72df commit 1393f96

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

R/descriptors.R

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@
2626
#' column, `..y`.
2727
#' }
2828
#'
29-
#' For example, if you use the model formula `mpg ~ .` with the `mtcars`
30-
#' data, the values would be
29+
#' For example, if you use the model formula `circumference ~ .` with the
30+
#' built-in `Orange` data, the values would be
3131
#' \preformatted{
32-
#' .preds() = 10 (the 10 columns in `mtcars`)
33-
#' .cols() = 10 (10 numeric columns + 0 from dummy variables)
34-
#' .obs() = 32
32+
#' .preds() = 2 (the 2 remaining columns in `Orange`)
33+
#' .cols() = 5 (1 numeric column + 4 from Tree dummy variables)
34+
#' .obs() = 35
3535
#' .lvls() = NA (no factor outcome)
36-
#' .facts() = 0 (no factor outcome)
37-
#' .y() = <vector> (mpg as a vector)
38-
#' .x() = <data.frame> (The other 10 columns as a data frame)
36+
#' .facts() = 1 (the Tree predictor)
37+
#' .y() = <vector> (circumference as a vector)
38+
#' .x() = <data.frame> (The other 2 columns as a data frame)
3939
#' .dat() = <data.frame> (The full data set)
4040
#' }
4141
#'
42-
#' If the formula `as.character(cyl) ~ .` where used:
42+
#' If the formula `Tree ~ .` were used:
4343
#' \preformatted{
44-
#' .preds() = 10 (the 10 numeric columns in `mtcars`)
45-
#' .cols() = 10 (same)
46-
#' .obs() = 32
47-
#' .lvls() = c("4" = 11, "6" = 7, "8" = 14)
44+
#' .preds() = 2 (the 2 numeric columns in `Orange`)
45+
#' .cols() = 2 (same)
46+
#' .obs() = 35
47+
#' .lvls() = c("1" = 7, "2" = 7, "3" = 7, "4" = 7, "5" = 7)
4848
#' .facts() = 0
49-
#' .y() = <vector> (as.character(cyl) as a vector)
50-
#' .x() = <data.frame> (The other 10 columns as a data frame)
49+
#' .y() = <vector> (Tree as a vector)
50+
#' .x() = <data.frame> (The other 2 columns as a data frame)
5151
#' .dat() = <data.frame> (The full data set)
5252
#' }
5353
#'

man/descriptors.Rd

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)