Sex Bwt Hwt
1 F 2.0 7.0
2 F 2.0 7.4
3 F 2.0 9.5
4 F 2.1 7.2
5 M 2.1 7.3
6 F 2.1 7.6
7 F 2.1 8.1
上面这个是部分数据,第一列是性别 第二列是体重 第三列也是一个重量
第一个问题是有多少只公猫,第二个问题是有多少只体重大于2的猫第三个问题是有多少只体重大于2的公猫?
这个是提示 Hint: Remember
that if X is a table, the syntax X[ X[,1] == "foobar", ]
can be used to select all rows of X whose rst entry is exactly the string foobar. In
the R jargon, this is often called subsetting.
没有太看懂提示X[ X[,1] == "foobar", ]的意思 还想问一下这个代码应该怎么写。谢谢大家