简体   繁体   English

在rmanovab(WRS2 R软件包)中使用函数head()的原因是什么?

[英]What's the reason of using the function head() in rmanovab (WRS2 R package)?

I would like to know why do I need to use the head(data) function in rmanovab (WRS2 R package)? 我想知道为什么我需要在rmanovab(WRS2 R软件包)中使用head(data)函数? For example: 例如:

head(WineTasting) rmanova(WineTasting$Taste, WineTasting$Wine, WineTasting$Taster) 头(品酒)rmanova(品酒$口味,品酒$红酒,品酒$品尝)

(Source: WRS2 user manual) (来源:WRS2用户手册)

If my data contains hundreds or thousands of rows, do I need to use head(data) before rmanovab? 如果我的数据包含成百上千行,我需要在rmanovab之前使用head(data)吗?

Thank you! 谢谢!

I believe this is just a choice the author of the package make when writing the manual. 我相信这只是软件包编写者在编写手册时的选择。 It is a common practice to inspect data before performing operations on it. 在对数据执行操作之前检查数据是一种常见的做法。 head() will give you the top rows of a given input. head()将为您提供给定输入的顶部行。 You can test this by running the example provided in the manual: 您可以通过运行手册中提供的示例进行测试:

> head(WineTasting)
   Taste   Wine Taster
 1  5.40 Wine A      1
 2  5.50 Wine B      1
.....
> rmanova(WineTasting$Taste, WineTasting$Wine, WineTasting$Taster)
  Test statistic: F = 3.2614
  .....

Note the .... were added by me to keep this post breif. 请注意....是我添加的,以保留此帖子的缩写。 Here is the same code without head. 这是没有头的相同代码。

> rmanova(WineTasting$Taste, WineTasting$Wine, WineTasting$Taster)
  Test statistic: F = 3.2614
  .....

The F statistic has not changed. F统计量没有改变。 head() does not matter for running the packages- but it does matter if you want to know what the data frame for the manual's example contains. head()对于运行程序包无关紧要,但是,如果您想知道手册示例的数据框架包含什么内容,则无关紧要。

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

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