含有罗马字母的txt转换为csv文件读取-报错
r语言绘图二(输入复杂的数学符号--希腊字母表) - R语言论坛 - 经管之家(原人大经济论坛) (pinggu.org)
CSV读取报错
gcmeta <- read.csv("metadata.csv")
> head(gcmeta) Sample Patient Tissue Platform Subtype Type Annotation 1 171012N P171012 Normal SC3P P01 Plasma P01_Plasma_IgA\xa6\xcb 2 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgA\xa6\xca 3 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgA\xa6\xca 4 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgA\xa6\xca 5 171012N P171012 Normal SC3P P01 Plasma P01_Plasma_IgA\xa6\xcb 6 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgA\xa6\xca
txt读取正确
gcmeta <- read.table("metadata.txt",
sep = "\t",header = T)#添加分隔符,
> head(gcmeta) Sample Patient Tissue Platform Subtype Type Annotation 1 171012N P171012 Normal SC3P P01 Plasma P01_Plasma_IgAλ 2 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgAκ 3 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgAκ 4 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgAκ 5 171012N P171012 Normal SC3P P01 Plasma P01_Plasma_IgAλ 6 171012N P171012 Normal SC3P P02 Plasma P02_Plasma_IgAκ
原因:可能是在WPS中进行TXT转CSV文件格式的时候出现错误。
R:导出包含utf编码希腊字符的txt或csv表-腾讯云开发者社区-腾讯云 (tencent.com)
原文地址:https://blog.csdn.net/hx2024/article/details/140597666
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!