dtkaplan / checkr

Checks code submissions in learnr (and potentially other) tutorials.
MIT License
28 stars 10 forks source link

Issue with using the ._arg functions #10

Open kate-pyper opened 4 years ago

kate-pyper commented 4 years ago

I have been trying to use checkr with learnr and keep coming across an issue when trying to extract function arguments. I have tried named_arg, function_arg and data_arg and get the same error. Using the examples provided:

code <- for_checkr(quote(lm(mpg ~ hp, data = mtcars))) formula_arg(code)

checkr result fail with message: Error : Can't take the names() of the .data pronoun

data_arg(code, insist("hp" %in% names(V), "The data should have a column named 'hp'."))

checkr result fail with message: Error : Can't take the names() of the .data pronoun

named_arg(code, "data", failif(E == mtcars, "I didn't want mtcars."))

checkr result fail with message: Error : Can't take the names() of the .data pronoun