I am trying to filer the "ToothGrowth" dataset by "dose" of the "supp" in R but I am receiving the below mentioned error.
CODE:
install.packages("dplyr")
data("ToothGrowth")
View(ToothGrowth)
filtered_tg <- filter(ToothGrowth, dose==0.5)
View (filtered_tg)
ERROR:
Error in filter(ToothGrowth, dose == 0.5) : object 'dose' not found View (filtered_tg)
CodePudding user response:
You need library(dplyr)
after install.packages("dplyr")
.