使用fread仅加载其他数据框中可用的数据线

发布于 2025-02-14 01:51:29 字数 346 浏览 0 评论 0 原文

我有大文件(1900万行x 16列),并想使用R和较小的文件(440行)使用R。

我使用 fread 加载大文件,然后使用 data.merge = merge(file1,file,by =“ car”)。但是,为了减少RI所需的内存,希望避免加载整个大文件。有没有一种方法可以使用 fread 仅加载我需要的行(重叠,例如,仅在“ car”中使用相同的汽车模型的行与文件1)?

例如:

fread("filepath.file2", by = file1$car)

I have large files (19 million rows x 16 columns) and want to harmonize one such file with a much smaller file (440 rows) using R.

I load the large file using fread and then use data.merge = merge(file1, file, by="car"). However, to reduce the memory needed in R I would like to avoid loading the whole big file. Is there a way to use fread to only load the rows I need (the overlap, e.g. only rows with the same car models in column "car" as file 1)?

For example:

fread("filepath.file2", by = file1$car)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文