复制频率矩阵图 [英] Reproduce frequency matrix plot

查看:99
本文介绍了复制频率矩阵图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个想在R中重新创建的情节.这是情节:

I have a plot that I would like to recreate within R. Here is the plot:

来自:Boring,E. G.(1941).统计频率为动态平衡.心理评论,48(4),279.

From: Boring, E. G. (1941). Statistical frequencies as dynamic equilibria. Psychological Review, 48(4), 279.

这比我的薪水(能力)略高,因此在这里询问.无聊的状态:

This is a little above my paygrade (abilities) hence asking here. Boring states:

第一次,A只能出现从不"(0)或总是"(1).在 第二次的频率 是0,1/2或1;在第三个0、1/3上 2/3或1等,等等.

On the first occasion A can occur only 'never' (0) or 'always' (1). On the second occasion the frequencies are 0,1/2, or 1; on the third 0, 1/3, 2/3, or 1 etc, etc.

很显然,您不必担心标签等.仅提示生成数据以及如何绘制就可以了. ;)我不知道如何开始...

Obviously, you don't have to worry about labels etc. Just a hint to generate the data and how to plot would be great. ;) I have no clue how to even start...

推荐答案

下面是一个示例:

library(plyr)
ps <- ldply(1:36, function(i)data.frame(s=0:i, n=i))
plot.new()
plot.window(c(1,36), c(0,1))
apply(ps, 1, function(x){
  s<-x[1]; n<-x[2];
  lines(c(n, n+1, n, n+1), c(s/n, s/(n+1), s/n, (s+1)/(n+1)), type="o")})
axis(1)
axis(2)

ps表示所有点.每个点有两个孩子. 因此,从每个点到孩子画线.

ps represents all points. Each point has two children. So draw lines from each point to the children.

这篇关于复制频率矩阵图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆