# Create data
xstart <- seq(0,4990000,length.out=500)
xloss <- rep(runif(10,0,0.6),rep(50,10))/1.5
xloss <- xloss + jitter(xloss,amount=0.002)
x <- data.frame(chromosome=rep(paste0("chr",1:5),rep(500,5)), start=xstart,
end=xstart+10000, loss=xloss, gain=(1-xloss))
# Plot the data
cnFreq(x)
Run the code above in your browser using DataLab