sneumann / mzR

This is the git repository matching the Bioconductor package mzR: parser for netCDF, mzXML, mzData and mzML files (mass spectrometry data)
40 stars 26 forks source link

Error in openMSfile(mzml) : 'filename' has to be of length 1 #222

Closed Mengxunn closed 4 years ago

Mengxunn commented 4 years ago

Hi, I am a beginner in R script, my code is like below. But there is an error in openMSfile(mzml) : 'filename' has to be of length 1, I don't know what does this mean an how to fix it? Thanks

filepath <- system.file("A3.mzML", package = "msdata") mzml <- list.files(filepath, pattern="A3.mzML", full.names=TRUE, recursive = TRUE) mz <- openMSfile(mzml)

lgatto commented 4 years ago

It means you can only read one file at a time. I suggest you use switch to the MSnbase package instead of mzR. You can use the readMSData to load many files at once.