sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
183 stars 80 forks source link

Vignette: avoid "data" as object name #704

Closed sneumann closed 8 months ago

sneumann commented 10 months ago

Hi, a user reported that following the vignette https://www.bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcms.html#21_Data_import which is using data leads to errors which I can reproduce:

data <- readMsExperiment(spectraFiles = cdfs, sampleData = pd)
...
> sampleData(data)
Error in sampleData(data) : inherits(object, "MsExperiment") is not TRUE
...
> data_3 <- data[3]
Error in data[3] : object of type 'closure' is not subsettable

To not suggest to users that using builtin function names is a good idea, we should avoid this. Frankly, I have no idea why it does work in the vignette itself :-( Yours, Steffen

jorainer commented 10 months ago

good point. Do you have maybe a suggestion for an alternative name of the variable? maybe mse? or lcms_data? or faahko?

jorainer commented 8 months ago

Done.