Skip to content

Commit

Permalink
Add case if no peaks detected in a sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lalo-caballero committed Jan 11, 2024
1 parent 3ba8507 commit 0bfca75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/peaks-GCIMSSample.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ setMethod(
if (is.null(object@peaks)) {
stop("Please run findPeaks() on the sample first")
}
tibble::as_tibble(cbind(SampleID = object@description, object@peaks))
if(nrow(object@peaks)==0){
p <- NULL
}else{
p <- tibble::as_tibble(cbind(SampleID = object@description, object@peaks))
}
return(p)
}
)

Expand Down

0 comments on commit 0bfca75

Please sign in to comment.