I am trying to paste x
in aes()
ggplot. I am running into an issue where ggplot is not recognizing the df column. Example below:
df2 <- data.frame(`Sum of MAE` = c(0.030156758080105, 0.0600065426668421,
0.0602272459239397, 0.0704327240953608, 0.09, 0.0900000000000001,
0.104746328560384, 0.106063964745531, 0.108373386847075, 0.110086738825851
), Company = c("COCO", "APWC", "EDS", "FREE", "VLYWW", "IKAN", "SPU", "ELON",
"WTSL", "MTSL"), check.names=F)
when I paste names(df2)[1] I don't get the column values. Note* I must use aes() and not aes_...etc Also, attempted as.name() but no luck.
ggplot(df2, aes(paste0(names(df2)[1]), Company, group=1)) + geom_line()
Any assistance is appreciated.