Entering edit mode
8.5 years ago
akang
▴
110
I have a text file with 3 columns (Chromosome number, Distance (BP) and r2). I want to plot LD decay for this data. Can anyone suggest how to do it? Here is the sample data
CHR dist(bp) r2
1 179160 0.03667880237
1 203115 0.007792207792
1 352949 0.0002724548179
1 389133 0.1577922078
1 464090 0.02009569378
1 829774 0.06714562034
1 1246697 0.01298701299
1 1698946 0.6255411255
1 1888668 0.003541912633
install.packages("ggplot2") library(ggplot2)
ggplot(file, aes(dist(bp), r2)) + geom_point() + geom_smooth(formula = newfile$file.dist(bp) ~ newfile$newr2, se=F)