levelplot - 如何使用它,有什么简单的例子吗?
我想了解 levelplot 是如何工作的。我对绘图和 R 几乎没有经验。
令我困惑的是,我应该如何解释 x~y*z ? 假设我有一个函数,我想通过使用 3d 图来显示某个值出现的频率。因此我会得到 x = x, y = f(x) 和 z = count。如何使用 levelplot (或其他方法,如果不合适的话)获得这样简单的图。
此外,我应该自己对数据进行“计数”分组 - 数据中的 3 列,还是只有 2 列 - x 和 f(x) 并且有重复项?
希望我的问题很清楚,我尝试阅读 levelplot文档,但是我找不到任何教授基础知识的教程。
I woud like to understand how levelplot works. I have almost no experience with plots and R.
What confuses me, is how should I interpret for example x~y*z ?
Lets assume I have a function, and I would like to show how often certain value occurs by using 3d plot. I would have hence x = x, y = f(x) and z = count. How to obtain such simple plot by using levelplot (or something else if it is not appriopriate).
In addition, should I group "count" myself - 3 columns in my data from, or just have 2 columns - x and f(x) and have duplications?
Hope my question is clear, I tried to read levelplot documentation, however I could not find any tutorial that teaches basics.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下示例来自
?levelplot
文档。公式
z~x*y
表示z
是x
、y
和 的函数x
和y
之间的交互。如果函数是z~x+y
,则意味着z
是x
和y
的函数,忽略任何交互作用。您可以在
?formula
的帮助中阅读有关公式界面的更多信息。The following example is from the
?levelplot
documentation.The formula
z~x*y
means thatz
is a function ofx
,y
and the interaction betweenx
andy
. Had the function beenz~x+y
it would have meant thatz
is a function ofx
andy
, ignoring any interaction.You can read more about the formula interface in the help for
?formula
.