Hi again, just a followup question. I've managed to create the line graph, but I changed the data to weeks, and it looks like this. Showing 1028 weeks instead of a select period does not look ideal, but that is the only way so far that did not give me any errors. I was thinking I should create a vector (with the old data that is in years+weeks), something like this: Labels<-c("2003U44", "2007U35", "2011U26", "2015U18", "2019U09").
Is this the right approach (check opening post for how I would like it to look)? Also how do I include it into this script:
ggplot(data = Vekt, aes(x = Week, y = Fresh)) + geom_line()
ggplot(data = Vekt, aes(x = Week)) + geom_line(aes(y = "Fresh"), color = "darkred") + geom_line(aes(y = Frozen), color = "steelblue", linetype = "twodash")
ggplot(Vekt, aes(Week)) +
geom_line(aes(y = Fresh, colour = "Fresh")) +
geom_line(aes(y = Frozen, colour = "Frozen")) + labs(x="Weeks", y="Ton")
This is how the data looks now:
head(Vekt)
Week Fresh Frozen
1 2000U01 3728 383
2 2000U02 4054 216
3 2000U03 4043 633
4 2000U04 3730 393
5 2000U05 3831 453
6 2000U06 4415 265
str(Vekt)
'data.frame': 1026 obs. of 3 variables:
Week : chr "2000U01" "2000U02" "2000U03" "2000U04" ...
Fresh : num 3728 4054 4043 3730 3831 ...
Frozen: num 383 216 633 393 453 265 344 542 490 738 ...