r - 从 R 中的文件夹中读取具有特定扩展名的文件
问题描述
我想使用函数 read.table 读取扩展名为 .output 的文件。我使用了 pattern=".output" 但它不正确。有什么建议么?
解决方案
例如,这里介绍了如何读取扩展名为“.output”的文件并创建表列表
list.filenames <- list.files(pattern="\\.output$")
trialsdata <- lapply(list.filenames,read.table,sep="\t")
或者,如果您只想手动一次阅读它们,只需在文件名参数中包含扩展名。
read.table("ACF.output",sep=...)
推荐阅读
- python - Discord.py 如何从消息 ID 中获取消息作者
- php - 如何在 Laravel Eloquent 中调用 DB 函数并使用分页?
- python - 素数计划:我想知道我成功计划的原因
- spring-boot - 如何自动将一类枚举转换为 VARCHAR
- vue.js - 如何在功能组件中使用插件的指令 - Vue 2
- portforwarding - 端口转发本地python服务器通过手机访问
- flutter - 如何计算动态小部件 totalPrice 变量值
- javascript - 无法获取 React(不是 CORS)- 来自 Fetch API 的 POST 请求在浏览器中被取消
- python-3.x - 用列表替换多个字符串
- javascript - 一段时间后取消 requestAnimationFrame 循环