Skip to content

Conversation

@statnmap
Copy link
Contributor

This looks into object to find data.frame and extract colnames.

This should work as is, but this requires extra work to allow {fcuk} to categorize origin of proposed words.
Something like this would be more informative :

Did you mean ?
- function : length() ?
- object : iris ?
- colnames : Sepal.Length ?

This looks into object to find data.frame and extract colnames.
@jonocarroll
Copy link

If data.frame subsetting threw a decent typed error when it couldn't find a column you could hook into that, but I don't think it does, a least yet

mtcars[, "foo"]
Error in `[.data.frame`(mtcars, , "foo") : undefined columns selected

@statnmap
Copy link
Contributor Author

Also, with NSE, this looks like this

> ggplot(mtcars) + aes(x = foo, y = bar)
Error in FUN(X[[i]], ...) : objet 'foo' introuvable

or

> mtcars %>% filter(foo == "toto")
Erreur : Problem with `filter()` input `..1`.
x objet 'foo' introuvable
ℹ Input `..1` is `foo == "toto"`.
Run `rlang::last_error()` to see where the error occurred.

@jonocarroll
Copy link

There's a higher chance those are properly typed errors. I'm not entirely sure how to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants