Dear list Maybe someone can help with the following problem: I have a source file containing the following code for plotting: pdf(file = 'data/mario/boxplot.pdf') bwplot(sig100 ~ target | group, data = fish, main = 'Boxplot der Signale in 100 Zellen nach Gruppe', xlab = '', ylab = 'Anzahl der Signale') dev.off() pdf(file = 'data/mario/xyplot.pdf') xyplot(sig100 ~ target | group, data = fish, main = 'Signale in 100 Zellen nach Gruppen', xlab = '', ylab = 'Anzahl der Signale', panel = function(x,y, ...) { panel.grid(h = -1, v = -1) panel.xyplot(x,y, jitter.x=TRUE) panel.lmline(x,y, lty = 2, col = 3)}) dev.off() If I run the file from R with source('lib/analysis_mario.R') a two pdf-files will be created but they cannot be read. When I use source('lib/analysis_mario.R', echo=TRUE) the files are created correctly. Actually I don't want the echo, so what can I do to plot correctly and omit the echo in one run. I use platform powerpc-apple-darwin8.9.1 arch powerpc os darwin8.9.1 system powerpc, darwin8.9.1 status major 2 minor 5.1 year 2007 month 06 day 27 svn rev 42083 language R version.string R version 2.5.1 (2007-06-27) -- Armin Goralczyk, M.D. Dept. of General Surgery University of G?ttingen G?ttingen, Germany http://www.chirurgie-goettingen.de
It's a FAQ #7.22 Wrap your plotting commands with print, that is, print(bwplot( )) and print(xyplot( )) Armin Goralczyk wrote:> > Dear list > Maybe someone can help with the following problem: > I have a source file containing the following code for plotting: > > pdf(file = 'data/mario/boxplot.pdf') > bwplot(sig100 ~ target | group, data = fish, main = 'Boxplot der > Signale in 100 Zellen nach Gruppe', xlab = '', ylab = 'Anzahl der > Signale') > dev.off() > > pdf(file = 'data/mario/xyplot.pdf') > xyplot(sig100 ~ target | group, data = fish, main = 'Signale in 100 > Zellen nach Gruppen', xlab = '', ylab = 'Anzahl der Signale', > panel = function(x,y, ...) { > panel.grid(h = -1, v = -1) > panel.xyplot(x,y, jitter.x=TRUE) > panel.lmline(x,y, lty = 2, col = 3)}) > dev.off() > > If I run the file from R with > source('lib/analysis_mario.R') > a two pdf-files will be created but they cannot be read. > > When I use > source('lib/analysis_mario.R', echo=TRUE) > the files are created correctly. > > Actually I don't want the echo, so what can I do to plot correctly and > omit the echo in one run. > > I use > > platform powerpc-apple-darwin8.9.1 > arch powerpc > os darwin8.9.1 > system powerpc, darwin8.9.1 > status > major 2 > minor 5.1 > year 2007 > month 06 > day 27 > svn rev 42083 > language R > version.string R version 2.5.1 (2007-06-27) > -- > Armin Goralczyk, M.D. >-- View this message in context: http://www.nabble.com/plot-from-source-file-tf4566488.html#a13038038 Sent from the R help mailing list archive at Nabble.com.
It's a FAQ (7.22) -thomas On Thu, 4 Oct 2007, Armin Goralczyk wrote:> Dear listMaybe someone can help with the following problem: I have a source file containing the following code for plotting: pdf(file = 'data/mario/boxplot.pdf') bwplot(sig100 ~ target | group, data = fish, main = 'Boxplot der Signale in 100 Zellen nach Gruppe', xlab = '', ylab = 'Anzahl der Signale') dev.off() pdf(file = 'data/mario/xyplot.pdf') xyplot(sig100 ~ target | group, data = fish, main = 'Signale in 100 Zellen nach Gruppen', xlab = '', ylab = 'Anzahl der Signale', panel = function(x,y, ...) { panel.grid(h = -1, v = -1) panel.xyplot(x,y, jitter.x=TRUE) panel.lmline(x,y, lty = 2, col = 3)}) dev.off() If I run the file from R with source('lib/analysis_mario.R') a two pdf-files will be created but they cannot be read. When I use source('lib/analysis_mario.R', echo=TRUE) the files are created correctly. Actually I don't want the echo, so what can I do to plot correctly and omit the echo in one run. I use platform powerpc-apple-darwin8.9.1 arch powerpc os darwin8.9.1 system powerpc, darwin8.9.1 status major 2 minor 5.1 year 2007 month 06 day 27 svn rev 42083 language R version.string R version 2.5.1 (2007-06-27) -- Armin Goralczyk, M.D. Dept. of General Surgery University of G??ttingen G??ttingen, Germany http://www.chirurgie-goettingen.de ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle