#Read data dat <- read.table("positions.dat",sep="\t",header=FALSE) #Have a look at the data head(dat) # If you failed fo order the values earlier in the exercise, # you can take the absolute value (abs() function) below. d = density(dat$V1-dat$V2, kernel="gaussian") #d = density(abs(dat$V1-dat$V2), kernel="gaussian") # This plots the length distribution plot(d, main="Length distribution for glimmer predictions") # The following saves the plot in a postscript file, # that can be opened with the program gv. postscript("length_plot.ps") plot(d, main="Length distribution for glimmer predictions") dev.off()