1

因此,我试图根据一组特定的值(在这种情况下为异常值)从数据集“mydata”中创建 R 中的 kable,但我找不到正确的上下文:

# this pulls out the outliers from the RATIO boxplot data
RT_outliers = (boxplot(mydata$RATIO, plot=FALSE)$out)

#below is my best shot so far as to how to create a table that 
#contains just the rows that have the outlier values
kable(mydata$[mydata$RATIO==RT_outliers])

有任何想法吗?

4

1 回答 1

0

mydata 之后的美元也是问题,您需要添加一个逗号,因为您正在过滤行

# this pulls out the outliers from the RATIO boxplot data
RT_outliers = (boxplot(mydata$RATIO, plot=FALSE)$out)

#below is my best shot so far as to how to create a table that 
#contains just the rows that have the outlier values
kable(mydata[mydata$RATIO==RT_outliers,])
于 2018-04-25T21:52:36.493 回答