Closed
Description
When using functions in dplyr against databases, prefixing certain functions seems to cause those functions to evaluate variable names in the global context, not the context of the data frame.
This isn't quite reprex-able, because I am not including making the connection.
In my case, con
is a connection to a Postgres database using RPostgres
. I suspect that doesn't matter based on how the error is showing up.
df <- tbl(con, "my_table")
> df %>% mutate(status = paste(subject, "abc")) #this works
# Source: lazy query [?? x 18]
# Database: postgres [db@db.rds.amazonaws.com:5432/postgres]
... #excluded for confidentiality
> df %>% mutate(status = base::paste(subject, "abc"))
Error in base::paste(subject, "abc") : object 'subject' not found