Navigation Menu

Skip to content

Commit

Permalink
Use stop() instead of warning() and return()
Browse files Browse the repository at this point in the history
  • Loading branch information
b4winckler committed May 14, 2012
1 parent d112cbe commit 80b59cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions R/bapp.R
Expand Up @@ -82,10 +82,8 @@ sigscore <- function(cats, pts)
if (is.vector(pts) && length(cats) == length(pts))
pts <- as.matrix(pts)

if (length(cats) != dim(pts)[1]) {
warning('Number of categories does not match rows of data')
return()
}
if (length(cats) != dim(pts)[1])
stop('Number of categories does not match rows of data')

m <- rbind(cats, t(pts))

Expand Down
6 changes: 2 additions & 4 deletions R/peaks-mixture-model.R
Expand Up @@ -36,10 +36,8 @@ plotPeak <- function(xlin)
p <- suppressWarnings(estimatePeaks(xlin))
df <- as.data.frame(p)
print(df)
if (any(is.na(df))) {
warning('Peak estimation failed, skipping...')
return()
}
if (any(is.na(df)))
stop('Peak estimation failed, skipping...')

# Detect which peak to pick:
# Take the one with smallest variability, unless it has a proportion
Expand Down

0 comments on commit 80b59cb

Please sign in to comment.