Hello, I'm new to rstudio and I have to do a project for university. I have to conduct a sentiment analysis with tweets and I want to create a longitudinal plot. My professor provided me these codes and the code for plotting doesn't work and i cannot locate the problem.
sent_plot %>%
tidy() %>%
separate(document, c("user_username", "day"), sep = "\.") %>%
mutate(day = as.Date(day)) %>%
filter(term == "positive") %>%
ggplot(aes(x = day, y = count, color = user_username, group = user_username)) + stat_smooth(se = FALSE, method = "loess", span = 0.15) + scale_color_manual(values = c("blue", "red")) +
scale_x_date(date_breaks = "8 months", date_labels = "%b-%Y") + scale_y_continuous(labels = scales::percent, limits = c(0,1)) +
labs(x = "Datum", y = "Anteil positives Sentiment", color = "Account")
when i apply the code i get a plot (the coordinate system) but there aren't any lines in it, so there is no data.
Sometimes I also get:
Error in 'mutate()'
In argument: 'day = as.Date(day)'.
Caused by error in 'as.Date.default()':
! do not know how to convert 'day' to class "Date"
I would be extremely happy if someone could help me because I'm stuck with this problem since 1 week