2012-04-07 143 views
1

我有一個數據,我想繪製累積函數。在R曲線中繪製對數()

的R代碼裏面我有如下:

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)) 

隨着我的代碼當前情節看起來像這樣(沒有數標度)。 我該如何修改我的代碼,使其在Y軸上繪製對數刻度?

的數據可以下載here

enter image description here

+0

我搜索了「r對數刻度」與谷歌和結束在http://stackoverflow.com/questions/1245273/histogram-with-logarithmic-scale,https://stat.ethz.ch/pipermail/r- help/2007-November/146367.html或其他... – phimuemue 2012-04-07 08:34:54

+0

當你知道數據集很大時,我真的認爲你應該放棄'print(dat)'。應該改用'print(head(dat))'和'summary(dat)'。 – 2012-04-07 12:33:20

回答

3

您可以將參數log = "y"添加到通話,但你必須從零改變最小程度的東西更高。有關此參數的詳細信息,請參閱?plot.default,該參數從curve開始傳遞。