Entering edit mode
5.0 years ago
rbronste
▴
420
Hi I have a data.frame that looks like the following:
V1 V2 V3 V4
5022970 196.2992494 191.5615348 186.9297418
5023003 98.0686565 97.03803578 96.12656665
5023061 68.8391627 69.53623005 70.76395006
5023121 96.98746392 97.94463568 98.81860247
The first column is a set of genomic locations and columns extending from V2 to V402 are values I want to plot, now I can do this for two columns (col1 = V1, col2 = V2) as follows:
df %>% ggplot() +
geom_point(aes(x = V1, y = V2)) +
scale_y_continuous(limits=c(0,200)) +
xlim(5022800, 5023050) + xlab("Genomic Position") +
geom_smooth(aes(x = V1, y = V2),
method="loess", span=.22, color = "red", fill = "black") +
theme_bw()
However I am not sure how to plot all columns from V2-V402 relative to those specific genomic points. Thanks.
Convert wide-to-long then plot.