Would anyone know why the data isn't plotting on this gpplot and how to troubleshoot it (see code below and image):
cultnature_fig <- culture_nature_long |>
ggplot(mapping = aes(x = epoch, y = rel_freq,)) +
geom_line(aes(linetype = Concept)) +
theme_classic() +
labs(x="Epoch", y="Relative Frequency") +
theme(axis.text.x=element_text(angle=45, hjust=1)) +
theme(legend.position=c(0.18,0.80))
print(cultnature_fig)
This is the error that comes up: "geom_line()
: Each group consists of only one observation.
Do you need to adjust the group aesthetic?"
Data frame looks like:
years concept proportion
1970-1974 A 0.003
1975-1979 B 0.005