简体   繁体   English

R频率表图y轴对数刻度

[英]R frequency table plot y-axis logarithm scale

Is there any option such as log='y' when plotting frequency table. 绘制频率表时是否有诸如log ='y'之类的任何选项。 My code is as following: 我的代码如下:

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

However it cannot display logarithm. 但是,它无法显示对数。 The error message is : 错误消息是:

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

Thanks! 谢谢!

也许您想做这样的事情:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM