# NOT RUN {
# Load the package's data set
data("CEUSNP"); data("CEUDist")
# Produce an LDheatmap object
MyLDheatmap <- LDheatmap(CEUSNP, genetic.distances = CEUDist, flip = TRUE)
# Generate an arbitrary vector of values to plot
Yvalues <- seq(length = length(MyLDheatmap$genetic.distances), from = 0.01, to = 0.5)
# Add scatter plot
assoc <- LDheatmap.addScatterplot(MyLDheatmap, Yvalues)
######## Adding three or more scatter plots ########
# Redefine LDheatmap.addScatterplot() to display the third scatter plot
LDheatmap.addScatterplot_test3 <- function(LDheatmap, P, height=0.2, ylab=NULL,
ylim=NULL, type="points",color,pch) {
if (dim(LDheatmap$LDmatrix)[1] != length(P)) {
print("Length of vector not equal number of SNPs in LDheatmap")
return()
flip <- !is.null(LDheatmap$flipVP)
vp <- constructVP(LDheatmap$LDheatmapGrob, 0.23, flip)
......
return(LDheatmap)
}}
environment(LDheatmap.addScatterplot_test3) <- asNamespace('LDheatmap')
# }
Run the code above in your browser using DataLab