I have a question regarding variable names in a legend from ggplot2
I believe that you find it simple, so I don´t provide reproducible code for now.
I run this ggplot2 query on long data:
ggplot(subset(BaumA_long,
Messpunkt %in% c("Tleaf","Tair","Tcrown","TbarkS","TbarkN", "Tsoil")),
aes(x=Zeit, y=value, color=Messpunkt)) +
geom_line(size=0.3) +
scale_x_datetime(limits=start.endKW26, labels = date_format("%d.%m. %H h",tz = "CET"),
breaks = date_breaks("12 hours"), expand = c(0, 0)) +
scale_y_continuous(limits = c(5, 55), breaks = seq(10, 55, by = 3)) +
labs(x="Datum", y="Temperatur") +
ggtitle("Cbet 1")+
theme(plot.title = element_text(vjust=-15),
axis.text.x = element_text(angle = 35))+
theme(legend.position='top') +
#labels=c("Tleaf"="Blatt", "Tair"="Luft", "Tcrown"="Krone",
# "TbarkS"="Borke_S", "TbarkN"="Borke_N","Tsoil"="Substrat") +
scale_color_manual(values = c("Tleaf" = "#339900", "Tair" = "blue", "Tcrown"= "red",
"TbarkS" = "orange2", "TbarkN" = "pink", "Tsoil" = "brown"))
this gives me the following plot:

All I want to change is the names of the variables "Tleaf" and so on in the legend. I tried with:
ggplot +
labels=c("Tleaf"="Blatt", "Tair"="Luft", "Tcrown"="Krone",
"TbarkS"="Borke_S", "TbarkN"="Borke_N","Tsoil"="Substrat") +
with no success.
For keeping my code clean and short I want to avoid renaming all the variables, because I have many datasets.