I want to plot this data frame with month on x-axis.
month value1 value2 value3 value4
1 Okt 19.5505 19.6145 19.5925 19.3710
2 Nov 21.8750 21.7815 21.7995 20.5445
3 Dez 25.4335 25.2230 25.2800 22.7500
attach(Mappe1)
month <- Mappe1$month
value1 <- Mappe1$value1
value2 <- Mappe1$value2
value3 <- Mappe1$value3
value4 <- Mappe1$value4
I tried different solutions, but with this code the months are plottet reversed (Dez, Nov, Okt, insted of Okt, Nov, Dez):
plot(x=month, y=value1, type="l", col="red")
lines(x=month, y=value2, type="l", col="seagreen")
lines(x=month, y=value3, type="l", col="cyan")
lines(x=month, y=value4, type="l", col="black", lwd=2)
using ggplot2 I get an error message: Error: Invalid input: time_trans works with objects of class POSIXct only
ggplot(Mappe1, aes(x=month, y=value1)) + geom_point() +
scale_x_datetime(breaks = date_breaks("1 month"), labels = date_format("%B")) +
xlab("month") + ylab("values")
I am very new to R Studio and very thankful about any help!