r - r中文件的read.table和Skype第一行
问题描述
我有一个文件,例如:
文件1.txt
#some info
#some other info
#information again
# Busco id Status Contig Start End Score Length
EOG091B0006 Complete scaffold_A 9626 40090 11575.7 6724
EOG091B0007 Fragmented scaffold_B 455 4244 1660.7 935
EOG091B000H Complete scaffold_C 4456 43328 7631.6 5014
我想阅读以下内容:
Busco id Status Contig Start End Score Length
EOG091B0006 Complete scaffold_A 9626 40090 11575.7 6724
EOG091B0007 Fragmented scaffold_B 455 4244 1660.7 935
EOG091B000H Complete scaffold_C 4456 43328 7631.6 5014
我试过了:
tab_busco=read.table(file1.txt",header=T,sep='\t',skip = 4)
但它不起作用......
解决方案
"#"
可能问题在于以因为"#"
被解释为注释开头的行。
尝试用任何其他字符替换它,例如:
df <- read.table("file1.txt", header = TRUE, skip = 3,
comment.char = "@", fill = TRUE)
推荐阅读
- kubernetes - Kubernetes:在 pod 启动时从文件中提取环境变量
- java - 从 pom.xml 获取项目版本
- kettle - PDI - PosgreSQL 批量加载错误、插入/更新和表输出缓慢
- java - 如何在 Android Studio 中从 sqlite 中保存、查看和删除图像?
- javascript - 如果正在执行另一个元素,则不会触发 HTML 元素上的事件。如何排队事件?
- asp.net - 将 Web 应用程序连接到控制台应用程序 vb.net 时会话超时
- powershell - 从我在 Powershell 中的当前目录路径中获取特定路径
- xwiki - Xwiki对比版
- python - 使用纯 python 将 docx 转换为 pdf(在 linux 上,没有 libreoffice)
- ruby-on-rails - 在 Sinatra 中查找两个日期之间的月数(2018-05-23 和 2018-06-22)