-
Notifications
You must be signed in to change notification settings - Fork 57
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
Using rename() results in error 'could not find function "setnames"' #123
Comments
Adding a reprex: library(dtplyr)
library(dplyr, warn.conflicts = FALSE)
mtcars %>%
lazy_dt() %>%
rename(miles_per_gallon = mpg)
#> Source: local data table [?? x 11]
#> Call: setnames(copy(`_DT1`), "mpg", "miles_per_gallon")
#> Error in setnames(copy(`_DT1`), "mpg", "miles_per_gallon"): could not find function "setnames" Yeah, it's doing more than just showing the call (works with data.table attached) library(data.table)
library(dtplyr)
library(dplyr, warn.conflicts = FALSE)
mtcars %>%
lazy_dt() %>%
rename(miles_per_gallon = mpg)
#> Source: local data table [?? x 11]
#> Call: setnames(copy(`_DT1`), "mpg", "miles_per_gallon")
#>
#> miles_per_gallon cyl disp hp drat wt qsec vs am gear
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 21 6 160 110 3.9 2.62 16.5 0 1 4
#> 2 21 6 160 110 3.9 2.88 17.0 0 1 4
#> 3 22.8 4 108 93 3.85 2.32 18.6 1 1 4
#> 4 21.4 6 258 110 3.08 3.22 19.4 1 0 3
#> 5 18.7 8 360 175 3.15 3.44 17.0 0 0 3
#> 6 18.1 6 225 105 2.76 3.46 20.2 1 0 3
#> # … with 1 more variable: carb <dbl>
#>
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results Created on 2019-11-12 by the reprex package (v0.3.0) |
This should work without loading data.table, so I've reopened to remind me to take a look at it. |
oh my. I think it's a simple typo: Line 13 in 6caf380
Needs to be |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately,
dtplyr
throws the following error whenrename()
is used:Error in setnames(copy(
_DT1), "mpg", "miles_per_gallon") : could not find function "setnames"
The text was updated successfully, but these errors were encountered: