Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Jan 24, 2013
1 parent daceb72 commit 091268c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MALDIquant
Version: 1.5
Date: 2012-12-06
Version: 1.5.1
Date: 2013-01-24
Title: Quantitative Analysis of Mass Spectrometry Data
Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"),
email="mail@sebastiangibb.de"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
RELEASE HISTORY OF THE "MALDIquant" PACKAGE
===========================================

Version 1.5.1 [2013-01-24]:
- .doByLabels: fix an error that occurred if all labels were unique (fixes #1);
affected functions: filterPeaks, mergeMassPeaks, mergeMassSpectra.

Version 1.5 [2012-12-06]:
- Add movingAverage.
- labelPeaks: add labels argument.
Expand Down
9 changes: 6 additions & 3 deletions R/doByLabels-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@
## drop unused levels and turn argument into factor
labels <- factor(labels);

if (length(labels) != length(l)) {
n <- length(l);

if (length(labels) != n) {
stop("For each item in ", sQuote("l"),
" there must be a label in ", sQuote("labels"), "!");
}

## replace tapply by split to preserve order
tmp <- lapply(split(unlist(l), labels), FUN=FUN, ...);

k <- unlist(tmp)
if (length(k) == length(l)) {
k <- unlist(tmp);

if (length(k) == n && length(tmp) != n) {
k <- unsplit(tmp, labels);
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions man/MALDIquant-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ For a first overview run \code{demo("MALDIquant")}.
\details{
\tabular{ll}{
Package: \tab MALDIquant\cr
Version: \tab 1.5\cr
Date: \tab 2012-12-06\cr
Version: \tab 1.5.1\cr
Date: \tab 2013-01-24\cr
License: \tab GPL (>= 3)\cr
URL: \tab http://strimmerlab.org/software/maldiquant/\cr
}
Expand Down

0 comments on commit 091268c

Please sign in to comment.