Error in filter(ToothGrowth, dose == 0.5) : object 'dose' not found

Hi guys, just started learning R and I am using the ToothGrowth data set in R to learn basic functions. I am getting
"Error in filter(ToothGrowth, dose == 0.5) : object 'dose' not found" when I try to assign and filter data.
Below is the code I have written


. can anyone help why this is happening?

data("ToothGrowth")
View(ToothGrowth)
install.packages('dbplyr')
library(dbplyr)
filtered_tg <- filter(ToothGrowth,dose==0.5)

2 Likes

Hi, it seems to work if you use dplyr instead of dbplyr:

library(dplyr)
filter(ToothGrowth, dose==0.5)

Unless you're connecting to a database, you would use dplyr.

2 Likes

Thank You so much. It worked.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.