Hello,
I have an interesting one here. This piece of code that I am about to produce runs fine within the RStudio IDE.
However, when I run it through an automated script it has problems.
The Reprex is below and it highlights the errors. But, when I just run the script in R Studio none of these errors are mentioned. I don't know what to do in order to have the script run through automation and directly in R Studio.
Reddit_URL <- "https://www.reddit.com/r/Health/"
Reddit_Health_Page = read_html(Reddit_URL)
#> Error in read_html(Reddit_URL): could not find function "read_html"
Topics = Reddit_Health_Page %>% html_nodes("#t3_oqrcdg ._eYtD2XCVieq6emjKBH3m ") %>% html_text()
#> Error in Reddit_Health_Page %>% html_nodes("#t3_oqrcdg ._eYtD2XCVieq6emjKBH3m ") %>% : could not find function "%>%"
Dates = Reddit_Health_Page %>% html_nodes("#t3_orhjln ._3jOxDPIQ0KaOWpzvSQo-1s ") %>% html_text()
#> Error in Reddit_Health_Page %>% html_nodes("#t3_orhjln ._3jOxDPIQ0KaOWpzvSQo-1s") %>% : could not find function "%>%"
Updates_Timed <- data.frame(Topics,Dates)
#> Error in data.frame(Topics, Dates): object 'Topics' not found
Created on 2021-07-26 by the reprex package (v2.0.0)