fcuk
fcuk copied to clipboard
WIP: get_all_objects : search through colnames
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 ?
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
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.
There's a higher chance those are properly typed errors. I'm not entirely sure how to check.