I am very new to R and am having trouble filling in the points on a line graph. When i enter my code no colours show on the plots, I am not sure what i am doing wrong. This is my code so far:
Mydata1 <- read_xlsx("41586_2020_2505_MOESM3_ESM.xlsx", sheet = 2)
Mydata1$Metabolite <- factor(Mydata1$Metabolite,
levels=c("G6P", "FBP", "Malate", "Citrate"))
ggplot(Mydata1, aes(x=`Time [hr]`, y=`Relative Flux (%)`, shape=Metabolite)) +
geom_line(lwd=0.5) +
geom_point(size=4) +
scale_shape_manual(values = c(21, 22, 23, 25)) +
scale_color_manual(values = c("dodgerblue4", "dodgerblue3",
"dodgerblue2", "dodgerblue1")) +
coord_cartesian(ylim=c(0, 6)) +
geom_hline(yintercept=1, linetype="longdash", size=1)
dput(head(Mydata1, 20))
structure(list(`Time [hr]` = c(0, 0.26, 0.63, 0.96, 1.31, 1.63,
1.98, 2.3, 2.63, 2.96, 3.38, 3.78, 4.16, 4.56, 4.95, 5.28, 5.65,
0, 0.26, 0.63), Metabolite = structure(c(1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L), .Label = c("G6P",
"FBP", "Malate", "Citrate"), class = "factor"), `Relative Flux (%)` = c(4.720286,
0.1610225, 0.1215011, 0.07619009, 0.02090246, 0.01812352, 0.02423107,
0.05935092, 0.08659023, 0.1906476, 0.2139404, 0.4618791, 0.2807972,
0.4641912, 0.6142707, 0.8049576, 0.7756669, 157.3645, 4.495637,
0.9071313)), row.names = c(NA, -20L), class = c("tbl_df", "tbl",
"data.frame"))
Thanks in advance for the help