Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call non-vectors "vectors" #122

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Don't call non-vectors "vectors" #122

merged 2 commits into from
Aug 9, 2022

Conversation

rossellhayes
Copy link
Contributor

@rossellhayes rossellhayes commented Aug 9, 2022

Remove messages with "vector" from the fallback method in friendly_class().
Now if the method falls back, it will always describe the object as an "object".
All atomic vectors types already have an associated friendly class message, so they will still be correctly described as vectors.

.result <- 1:2
.solution <- lm(mpg ~ wt, data = mtcars)
tbl_grade_class()
#> <gradethis_graded: [Incorrect]
#>   Your result should be an object with class `lm`, but it is a vector
#>   of integers (class `integer`).
#> >

.result <- 1:2
.solution <- c("1", "2")
tbl_grade_class()
#> <gradethis_graded: [Incorrect]
#>   Your result should be a vector of text (class `character`), but it is
#>   a vector of integers (class `integer`).
#> >

Created on 2022-08-09 by the reprex package (v2.0.1)

Closes #120.

@rossellhayes rossellhayes added the bug Something isn't working label Aug 9, 2022
@rossellhayes rossellhayes self-assigned this Aug 9, 2022
@rossellhayes rossellhayes merged commit 9318f6d into main Aug 9, 2022
@rossellhayes rossellhayes deleted the fix/dont-say-vector branch August 9, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tbl_grade_class() calls anything with length > 1 a vector
1 participant