2

I have a data which I want to plot in cumulative function.

The R code I have is the following:

dat <- read.table("evalues_point.txt" )
pre.test <- dat$V1
print (pre.test)

pre.ecdf <- ecdf(pre.test)
rx <- range(pre.test)
ry <- max(length(pre.test))


curve(length(pre.test)*(1-pre.ecdf(x)), from=rx[1], to=rx[2], col="red", xlim=rx, ylim=c(0,ry))

With that code of mine the current plot looks like this (no-log scale). How can I modify my code so that it plots log-scale in its Y-axis?

The data can be downloaded here

enter image description here

Dason
  • 60,663
  • 9
  • 131
  • 148
neversaint
  • 60,904
  • 137
  • 310
  • 477
  • I searched "r logarithmic scale" with google and ended up at http://stackoverflow.com/questions/1245273/histogram-with-logarithmic-scale, https://stat.ethz.ch/pipermail/r-help/2007-November/146367.html, or others... – phimuemue Apr 07 '12 at 08:34
  • I really think you should leave off the `print(dat)` when you know that the dataset is large. Should instead use `print(head(dat))` and `summary(dat)`. – IRTFM Apr 07 '12 at 12:33

1 Answers1

4

You can add the argument log = "y" to the call, but you'll have to change the minimum extents from zero to something higher. See ?plot.default for details on this argument, which is passed along from curve.

mdsumner
  • 29,099
  • 6
  • 83
  • 91