View source: R/tbl_check_groups.R
tbl_check_groups | R Documentation |
Checks if object
and expected
have the same groups.
If the groups differ
tbl_check_groups()
returns a list describing the problem
tbl_grade_groups()
returns a failing grade and informative message
with gradethis::fail()
tbl_check_groups(object = .result, expected = .solution, env = parent.frame()) tbl_grade_groups( object = .result, expected = .solution, max_diffs = 3, env = parent.frame(), ... )
object |
An object to be compared to |
expected |
An object containing the expected result. |
env |
The environment in which to find |
max_diffs |
|
... |
Arguments passed on to
|
If there are any issues, a list from tbl_check_groups()
or a
gradethis::fail()
message from tbl_grade_groups()
.
Otherwise, invisibly returns NULL
.
groups
: The object has groups that are not expected,
or is missing groups that are expected.
.result <- dplyr::group_by(tibble::tibble(a = 1:10, b = 11:20), a) .solution <- dplyr::group_by(tibble::tibble(a = 1:10, b = 11:20), b) tbl_check_groups() tbl_grade_groups()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.