Plotting scatterplots with pairs in R, in log scale with data containing zeros

感情迁移 提交于 2019-12-01 20:39:29

You ignored this (where I called your data frame DF):

R> pairs(~X+Y+Z, data=df, log="xy")
There were 30 warnings (use warnings() to see them)

and if you look at these thirty warnings, you will see that

  • you cannot plot data containing zeros on a log scale (and I guess you know why)

  • log is not a recognised parameter for pairs()

So if you want a pairs plot in logs, you may have to takes logs yourself (and either add a small epsilon or use a transformation like log(1 + x) and call pairs() on that data.

Edit The easiest is probably pairs(~X+Y+Z, data=log(1+DF))

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!