r - 使用 MetaboAnalystR 包时导入 .csv 文件时遇到问题
问题描述
我是一个非常新手的 R 用户,并且在使用 RStudio 中的“导入数据集”按钮导入我的 .csv 文件时遇到了困难。我曾尝试查看其他人提出的类似问题,但无济于事。我检查了我的数据集并确保所有空格都替换为 _ 并且我的代谢物没有重复名称。但是,我不断收到相同的错误消息。
这是我来自控制台的代码和产生的错误消息:
ANOVA2fdr <- read.csv("C:/Users/earha/OneDrive/Metabolomics/Second Analysis/Analyses/AOVA2fdr/ANOVA2fdr.csv")
View(ANOVA2fdr)
library(MetaboAnalystR)
mSet<-InitDataObjects("conc", "ts", FALSE)
[1] "MetaboAnalyst R objects initialized ..."
Warning message:
In Cairo::CairoFonts(regular = "Arial:style=Regular", bold = "Arial:style=Bold", :
CairoFonts() has no effect on Windows. Please use par(family="...") to specify the desired font - see ?par.
mSet<-SetDesignType(mSet, "g2")
mSet<-Read.TextData(mSet, ANOVA2fdr, "rowts", "disc");
<simpleError in data.table::fread(fileName, header = TRUE, check.names = FALSE, blank.lines.skip = TRUE, data.table = FALSE): input= must be a single character string containing a file name, a system command containing at least one space, a URL starting 'http[s]://', 'ftp[s]://' or 'file://', or, the input data itself containing at least one \n or \r>
[1] "Using slower file reader ..."
<simpleWarning in if (formatStr == "txt") { dat <- try(read.table(fileName, header = TRUE, comment.char = "", check.names = F, as.is = T))} else { dat <- try(read.csv(fileName, header = TRUE, comment.char = "", check.names = F, as.is = T))}: the condition has length > 1 and only the first element will be used>
[1] "Using slower file reader ..."
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
'file' must be a character string or connection
In addition: Warning message:
In if (formatStr == "txt") { :
he condition has length > 1 and only the first element will be used
[1] "Data format error. Failed to read in the data!"
[1] "Make sure the data table is saved as comma separated values (.csv) format!"
[1] "Please also check the followings: "
[1] "Either sample or feature names must in UTF-8 encoding; Latin, Greek letters are not allowed."
[1] "We recommend to use a combination of English letters, underscore, and numbers for naming purpose."
[1] "Make sure sample names and feature (peak, compound) names are unique."
[1] "Missing values should be blank or NA without quote."
[1] "Make sure the file delimeters are commas."
谢谢你尽你所能的帮助!
解决方案
推荐阅读
- ios - 如何在tableview单元格内的collectionview单元格的按钮单击上获取索引
- amazon-web-services - 如何从修剪图像中停止 docker-machine create
- ormlite-servicestack - 在 ServiceStack.OrmLite 中多次加入同一个表
- assembly - 四向引力引擎问题 (Atari 2600)
- reactjs - (0, _reactNavigation.withOrientation) 不是函数错误
- javascript - 标记聚类,谷歌地图 API
- c# - 在 ClosedXML.Excel C# 中将列格式更改为货币
- java - Android Dialog setContentView 不执行布局的上下文 java 文件
- laravel - 我无法使用 Laravel 进行查询
- c - 使用 calloc 初始化 void* 缓冲区