I'm trying to make a plot like this:
When I attempt with x=variable, y=value, and group=[an identified cluster], I get the following plot.
I start with scaled model indicators, which are columns including age, vital signs, laboratory values, and medications. I also have id and cluster as variables.
melt_mod_indic_z<-melt(mod_indic_z, id.vars=c('cluster'))
ggplot(melt_mod_indic_z) +
geom_line(aes(variable, value, group = cluster,
color = cluster))
Is there a way to correct this? Thanks in advance!