I would like to create a LD vs distance(cm) plot in R using an output from PLINK. I have been trying with different --ld-window-kb  numbers but I can not plot them in R. Furthermore, I have a question  about average r2. In some papers ld_decay is plotted average r2 vs distance and some papers used  r2 vs  distance. Can everybody explain more?  
thanks for your attention 

For LD block length distribution, I ran this on the thinned SNP set.

    plink --bfile "snp-thin"  --blocks --blocks-max-kb 200 --out "snp-thin"

This produces snp-thin.blocks.det. Then some R.

    dfr <- read.delim("snp-thin.blocks.det",sep="",header=T,check.names=F,stringsAsFactors=F)
    colnames(dfr) <- tolower(colnames(dfr))
    
    # ld block density
    p <- ggplot(dfr,aes(x=kb))+
      geom_density(size=0.5,colour="grey40")+
      labs(x="LD block length (Kb)",y="Density")+
      theme_bw()
    
    ggsave("snp-thin-ld-blocks.png",p,height=8,width=8,units="cm",dpi=250)
    
![enter image description here][5]

Now you see LD block length distribution for your set of samples.

  [5]: https://image.ibb.co/mjzPOH/snp_thin_ld_blocks.png