【发布时间】:2020-07-13 08:51:38
【问题描述】:
我正在https://bioinformatics-core-shared-training.github.io/r-crash-course/crash-course.nb.html 为 R 开设速成课程
我面临的问题是提取某个值的最小值或最大值的行。
例如运行时
df[df$tmp ==min(df$tmp),]
我得到了具有预期值的正确行。
但是,当运行以下代码时
df[min(df$tmp),]
我得到了完全不同的东西。
我想知道是什么导致了这种差异?
【问题讨论】:
-
谢谢大家的回答。但是,正确的方法有点奇怪,因为代码中有很多冗余!还是谢谢
标签: r dataframe subset extract min