r - 从R中的csv导入几行

标签 r

我有 N 行的 csv 文件,其中每一行对应一个数据点。有没有办法从这个 csv 文件中读取一组预先指定的行。

最佳答案

您可以指定 skipnrows read.csv 的参数:

skip integer: the number of lines of the data file to skip before beginning to read data.

nrows integer: the maximum number of rows to read in. Negative and other invalid values are ignored.

关于r - 从R中的csv导入几行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13828512/

相关文章:

r - ranger.forest 的组件含义

r - 大型数据集中的选择/投影/分组

r - 将 ifelse() 应用于向量的每个元素

r - 在 R 中查找栅格堆栈上的第二高值

r - 如何根据不同的类别找到多少个唯一值

r - 如何通过 R 中的 For 循环创建多个线性回归模型?

r - 通过两个数据帧和一个矩阵进行匹配和索引

使用 XML-Package 在 R 中使用 XPath 检索图像源

当颜色离散时,R plotly 散点图标记大小似乎取决于颜色

r - 如何从 R 关闭 pdf 文件