Skip to content

Commit

Permalink
added plot function for rawRchromatogramSet #1
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Oct 21, 2020
1 parent 02efaec commit 50aebc4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions R/rawR.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,25 @@ readChromatogram <- function(rawfile,
rv
}

plot.rawRchromatogramSet <- function(x, ...){
plot(0, 0, type='n',
xlim=range(unlist(lapply(x, function(o){o$times}))),
ylim=range(unlist(lapply(x, function(o){o$intensities}))),
frame.plot = FALSE,
xlab='retention time [in min]',
ylab='intensities'
)

cm <- hcl.colors(length(x), "Set 2")
mapply(function(o, co){lines(o$times, o$intensities, col=co)}, x, cm)
legend("topleft",
as.character(sapply(X, function(o){o$mass})),
col=cm,
pch=16,
title='target mass [m/z]',
bty='n',cex = 0.75)
}

#' Create instances of class \code{rawRspectrum}
#'
#' Developer function.
Expand Down
2 changes: 1 addition & 1 deletion vignettes/JPR_TechnicalNote.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ author: "Tobias Kockmann^1‡^ & Christian Panse^1,2‡^"
date: "`r Sys.Date()`"
bibliography: rawR.bib
output:
pdf_document: default
html_document:
df_print: paged
citation_package: natbib
pdf_document: default
vignette: |
%\usepackage[utf8]{inputenc}
%\VignetteEncoding{UTF-8}
Expand Down

0 comments on commit 50aebc4

Please sign in to comment.