Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasenfinch committed Nov 11, 2021
1 parent 7a85999 commit b50e212
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plotTheme <- function(){
strip.text = element_text(face = 'bold'))
}

binPlot <- function(dat,bin,m,dp,type){
binPlot <- function(dat,bin,m,dp,type,cls){
pl <- ggplot(dat,aes(x = mz)) +
geom_density() +
xlim(m - 5 * 10^-(dp + 1),
Expand All @@ -25,15 +25,14 @@ binPlot <- function(dat,bin,m,dp,type){
y = 'Density')

if (type == 'cls') {
class <- cls(x)

if (length(class) == 0) {
if (length(cls) == 0) {
stop('No "cls" parameter found for this Binalysis class object.',
call. = FALSE)
}

pl <- pl +
facet_wrap(as.formula(paste("~", class)))
facet_wrap(as.formula(paste("~", cls)))
}

if (type == 'sample') {
Expand Down Expand Up @@ -82,7 +81,9 @@ setMethod('plotBin',signature = 'Binalysis',
dp <- str_extract(bin,'(?<=[.])[\\w+.-]+') %>%
nchar()

binPlot(dat,bin,m,dp,type)
class <- cls(x)

binPlot(dat,bin,m,dp,type,class)
}
)

Expand Down

0 comments on commit b50e212

Please sign in to comment.