diff --git a/DESCRIPTION b/DESCRIPTION index 5fdc53c99..b26457f88 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mzR Type: Package Title: parser for netCDF, mzXML and mzML and mzIdentML files (mass spectrometry data) -Version: 2.41.1 +Version: 2.41.2 Author: Bernd Fischer, Steffen Neumann, Laurent Gatto, Qiang Kou, Johannes Rainer Authors@R: c( person("Steffen", "Neumann", email="sneumann@ipb-halle.de", role=c("aut","cre")), diff --git a/NEWS b/NEWS index d6cf359f2..4d0786e91 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +CHANGES IN VERSION 2.41.2 +------------------------- +o Use "rtime" and "intensity" as column names for the data.frame returned by + chromatogram() (# 304). + CHANGES IN VERSION 2.41.1 ------------------------- o Fix compilation error with stricter compiler checks diff --git a/inst/unitTests/test_chromatograms.R b/inst/unitTests/test_chromatograms.R index d1764bf0b..50a2c14a7 100644 --- a/inst/unitTests/test_chromatograms.R +++ b/inst/unitTests/test_chromatograms.R @@ -11,6 +11,8 @@ test_chromatograms1 <- function() { checkIdentical(nrow(chromatogram(x, 136L)), 527L) checkIdentical(nrow(chromatogram(x, 137L)), 567L) checkIdentical(nrow(chromatogram(x, 138L)), 567L) + chr <- chromatogram(x, 138L) + checkIdentical(colnames(chr), c("rtime", "intensity")) } test_chromatograms2 <- function() { diff --git a/man/peaks.Rd b/man/peaks.Rd index c5bc0bdcf..1c2a8a82a 100644 --- a/man/peaks.Rd +++ b/man/peaks.Rd @@ -125,9 +125,8 @@ The \code{chromatogram} (\code{chromatograms}) accessors return chromatograms for the MS file handle. If a single index is provided, - as \code{data.frame} containing the retention time (1st columns) and - intensities (2nd column) is returned. The name of the former is always - \code{time}, while the latter will depend on the run parameters. + as \code{data.frame} containing the retention time (\code{"rtime"}, + 1st column) and intensities (\code{"intensity"}, 2nd column) is returned. If more than 1 or no chromatogram indices are provided, then a list of chromatograms is returned; either those passed as argument or all of diff --git a/src/RcppPwiz.cpp b/src/RcppPwiz.cpp index 91b4fa8e7..9b803b6c7 100644 --- a/src/RcppPwiz.cpp +++ b/src/RcppPwiz.cpp @@ -866,8 +866,8 @@ Rcpp::DataFrame RcppPwiz::getChromatogramsInfo( int whichChrom ) intensity.push_back(p.intensity); } - chromatogramsInfo = Rcpp::DataFrame::create(Rcpp::_["time"] = time, - Rcpp::_[c->id] = intensity); + chromatogramsInfo = Rcpp::DataFrame::create(Rcpp::_["rtime"] = time, + Rcpp::_["intensity"] = intensity); } return(chromatogramsInfo);