R频率表绘制y轴对数标度

时间:2013-08-10 17:05:59

标签: r plot scale frequency logarithm

绘制频率表时是否有任何选项,例如log ='y'。我的代码如下:

df = read.table(myfile, header=F, sep=',')
freq = table(df[[1]]) # make frequency table for the first column
plot(freq, log='y')

然而,它无法显示对数。错误消息是:

Warning messages:
1: In plot.window(...) :
  nonfinite axis limits [GScale(-inf,7.0814,2, .); log=1]
2: In axis(...) : "log" is not a graphical parameter

谢谢!

1 个答案:

答案 0 :(得分:1)

也许你想做这样的事情:

plot(as.numeric(names(freq)),as.numeric(freq),log='y',xlab='',ylab='freq')