Indiana_cost_df <- tidy_tuition %>%
filter(State == "Indiana" && "DC" && "VA")
Indiana_cost_plot <- ggplot(Indiana_cost_df ,aes(x=year,y=cost)) +
geom_line(color="deeppink1", size=1) +
theme(text = element_text(size = 18))+labs(
x = "Years", y = "Tuition Cost ",
title = "Variation of tuition cost in IN")
#> Error in ggplot(Indiana_cost_df, aes(x = year, y = cost)): could not find function "ggplot"
Indiana_cost_plot+transition_reveal(year)
#> Error in eval(expr, envir, enclos): object 'Indiana_cost_plot' not found
facet_wrap(~State)
#> Error in facet_wrap(~State): could not find function "facet_wrap"
In general errors should be addressed from top(first) to bottom(last). Therefore address could not find function ggplot
This is usually addressed by calling the library containing the functions one wants to use.
In your case library(tidyverse) will do as it contains ggplot2 library.
Aside from that, I would expect this wont work for you :
filter(State == "Indiana" && "DC" && "VA")
because for it to succeed the value of State must be contradictory, better to use