check_row_order
argument to tbl_check()
, tbl_grade()
, and tbl_equal()
. When check_row_order()
is set to false, object
and expected
are arranged so that their row orders match before checking for differences in column values.tbl_equal()
, which returns a TRUE
or FALSE
value indicating if two tables are equivalent, using the same process as tbl_check()
.tbl_check()
, tbl_grade()
, tbl_check_column()
, tbl_grade_column()
and vec_grade()
gain arguments to set whether they will check the levels of factors.vec_check()
and vec_grade()
now only check factor levels if both object
and expected
are factors. In most cases, this difference would be caught earlier by class checking. Previously, calling vec_check(x, factor(x), check_class = FALSE)
would signal a problem because one vector has levels and the other does not.tbl_grade_class()
now internally call two generic S4 functions:friendly_class()
generates class names for single objects.friendly_class(character(1))
returns "a text string (class character
)".hinted_class_message()
generates messages when object
and expected
are both a specific class.object
is an ungrouped tibble and expected
is a grouped tibble, hinted_class_message()
generates a message that suggests using group_by()
.tbl_grade_class()
messages to be expanded by adding methods for new classes in tutorial setup code or external packages.grade_this_table()
now sets pass_if_equal = FALSE
by default (#128).tbl_grade_class()
:group_by()
, ungroup()
and rowwise()
if both object
and expected
are data.frame
s (#119).Messages now describe non-atomic variables with length > 1 as "objects", not "vectors" (#122).
problem()
and problem_message()
are now exported functions. The first helps other packages create problem objects and the second is a generic method that can be used to turn a problem object into a human readable description (#124).
tblcheck_grade()
is now called problem_grade()
. The old function name will continue to work, but a deprecation warning will prompt you to update to problem_grade()
(#124).tolerance
argument to vec_*_values()
(#111).ignore_class
to class checks (and passed by table
, vector
, and column
checks), specifying class differences to ignore (#109).grouped_df
class if check_groups = FALSE
(#109).setequal()
instead of identical()
, so objects with the same classes in different orders will not trigger a class
problem (#109).c(1, 2, 3)
and c(2, 1, 3, 2)
) (#104).grade_this_table()
and grade_this_vector()
provide (#95).vec_grade_values()
now treats NA
values in the same position of the object
and expected
vectors as equal (#96).grade_this_table()
was updated to include the cols
and check_column_order
arguments that were recently added to tbl_grade()
(#92).gradethis
.gradethis
-style grading for tables and vectors that compare the student's result with the exercies -solution
:grade_this_table()
for automated grading of tablesgrade_this_vector()
for automated grading of vectorsgrade
function that returns a gradethis
grade and a check
function that returns a list detailing the differences between actual and expected output.tbl_grade()
and tbl_check()
check that a tibble or data frame matches an expected output.vec_grade()
and vec_check()
check that a vector marches an expected output.tbl_grade_column()
and tbl_check_column()
check that a single column of a tibble or data frame matches an expected output (powered by vec_grade()
and vec_check()
).tbl_grade_class()
, tbl_check_class()
, vec_grade_class()
and vec_check_class()
check that the class of an object matches that of an expected output.tbl_grade_dimensions()
, tbl_check_dimensions()
, vec_grade_dimensions()
and vec_check_dimensions()
check that the length, number of rows and columns, and number of dimensions of an object match that of an expected output.tbl_grade_groups()
and tbl_check_groups()
check that the groups of a table (created by dplyr::group_by()
) match that of an expected output.vec_grade_levels()
and vec_check_levels()
check that the levels of a factor match that of an expected output.tbl_grade_names()
, tbl_check_names()
, vec_grade_names()
and vec_check_names()
check that the names of an object match that of an expected output.vec_grade_values()
and vec_check_values()
check that the values of a vector match that of an expected output.problem
output of check
functions.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.