Releases: rstudio/tblcheck
Releases · rstudio/tblcheck
Version 0.3.1
- Add
check_row_order
argument totbl_check()
,tbl_grade()
, andtbl_equal()
. Whencheck_row_order()
is set to false,object
andexpected
are arranged so that their row orders match before checking for differences in column values.
Version 0.3.0
- Add
tbl_equal()
, which returns aTRUE
orFALSE
value indicating if two tables are equivalent, using the same process astbl_check()
. tbl_check()
,tbl_grade()
,tbl_check_column()
,tbl_grade_column()
andvec_grade()
gain arguments to set whether they will check the levels of factors.vec_check()
andvec_grade()
now only check factor levels if bothobject
andexpected
are factors. In most cases, this difference would be caught earlier by class checking. Previously, callingvec_check(x, factor(x), check_class = FALSE)
would signal a problem because one vector has levels and the other does not.
v0.2.2
- Messages generated by
tbl_grade_class()
now internally call two generic S4 functions:friendly_class()
generates class names for single objects.- e.g.
friendly_class(character(1))
returns "a text string (classcharacter
)".
- e.g.
hinted_class_message()
generates messages whenobject
andexpected
are both a specific class.- e.g. if
object
is an ungrouped tibble andexpected
is a grouped tibble,hinted_class_message()
generates a message that suggests usinggroup_by()
.
- e.g. if
- Using generic functions allows
tbl_grade_class()
messages to be expanded by adding methods for new classes in tutorial setup code or external packages.
v0.2.1
v0.2.0
tblcheck 0.2.0
-
Improve messages generated by
tbl_grade_class()
: -
problem()
andproblem_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).
Deprecated Functions
tblcheck_grade()
is now calledproblem_grade()
. The old function name will continue to work, but a deprecation warning will prompt you to update toproblem_grade()
(#124).
v0.1.3
Version 0.1.2
- Adds argument
ignore_class
to class checks (and passed bytable
,vector
, andcolumn
checks), specifying class differences to ignore (#109). - Table checking now ignores the
grouped_df
class ifcheck_groups = FALSE
(#109). - Classes are now checked with
setequal()
instead ofidentical()
, so objects with the same classes in different orders will not trigger aclass
problem (#109). - Fixed a bug where a message would not be generated for a values problem where two vectors were different but were made up of the same unique values (e.g.
c(1, 2, 3)
andc(2, 1, 3, 2)
) (#104).
v0.1.1
- Fixed the messages for values problems originating in columns to mention the problematic column (#100).
- A new vignette with exercise examples demonstrates the types of feedback
grade_this_table()
andgrade_this_vector()
provide (#95). vec_grade_values()
now treatsNA
values in the same position of theobject
andexpected
vectors as equal (#96).grade_this_table()
was updated to include thecols
andcheck_column_order
arguments that were recently added totbl_grade()
(#92).
v0.1.0: tblcheck 0.1.0
tblcheck v0.1.0
- New package for inspecting data frames and vectors for grading with
gradethis
. - Includes drop-in
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 vectors
- Additional, lower-level functions come in two variants, a
grade
function that returns agradethis
grade and acheck
function that returns a list detailing the differences between actual and expected output. - Includes three general purpose checking functions:
tbl_grade()
andtbl_check()
check that a tibble or data frame matches an expected output.vec_grade()
andvec_check()
check that a vector marches an expected output.tbl_grade_column()
andtbl_check_column()
check that a single column of a tibble or data frame matches an expected output (powered byvec_grade()
andvec_check()
).
- Includes six even more specific checking functions:
tbl_grade_class()
,tbl_check_class()
,vec_grade_class()
andvec_check_class()
check that the class of an object matches that of an expected output.tbl_grade_dimensions()
,tbl_check_dimensions()
,vec_grade_dimensions()
andvec_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()
andtbl_check_groups()
check that the groups of a table (created bydplyr::group_by()
) match that of an expected output.vec_grade_levels()
andvec_check_levels()
check that the levels of a factor match that of an expected output.tbl_grade_names()
,tbl_check_names()
,vec_grade_names()
andvec_check_names()
check that the names of an object match that of an expected output.vec_grade_values()
andvec_check_values()
check that the values of a vector match that of an expected output.
- Also includes a number of functions for dealing with the
problem
output ofcheck
functions.