[OGRUG] R-UG-Ottawa Digest, Vol 10, Issue 1

Prof. John C Nash nashjc at uottawa.ca
Tue Jul 20 15:20:46 CEST 2010


Very quick (and possibly tangential) idea is to use Sweave. However, I can say right away 
that the outcome may not be entirely what you need, but would be quick if you know how to 
use Sweave.

JN

On 07/20/2010 06:00 AM, r-ug-ottawa-request at r-project.org wrote:
> Send R-UG-Ottawa mailing list submissions to
> 	r-ug-ottawa at r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://stat.ethz.ch/mailman/listinfo/r-ug-ottawa
> or, via email, send a message with subject or body 'help' to
> 	r-ug-ottawa-request at r-project.org
>
> You can reach the person managing the list at
> 	r-ug-ottawa-owner at r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-UG-Ottawa digest..."
>
>
> Today's Topics:
>
>     1. Putting two figures together in R (Young Song)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 19 Jul 2010 15:28:56 -0700
> From: Young Song<youngcsong at gmail.com>
> To: r-ug-ottawa at r-project.org
> Subject: [OGRUG] Putting two figures together in R
> Message-ID:
> 	<AANLkTiksar-COjrdpywyVJA_3qrnQxCNahrhLizrI4YJ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
>     I have two scripts that are used to generate heatmap and bar graph
>
> *A. Heatmap script:*
>
> library(RColorBrewer)
> library(gplots)
>
> par(mfrow=c(2,1))
>
> Totaltax<-read.table("heatmap_data.txt",header=TRUE)
> Totaltax_log<-log(Totaltax+1)
> Totaltax_mat<-data.matrix(Totaltax_log)
> Totaltax_column<-t(Totaltax_mat)
> cdendro<-as.dendrogram(hclust(dist(Totaltax_column,
> method="manhattan")),method="complete")
> heatmap.2(Totaltax_mat, Colv=cdendro, distfun=dist, key=TRUE, keysize=1,
> trace="none", margins=c(5,13), col=brewer.pal(9,"BuPu"))
>
>
> *B. Bar graph script:*
>
> histo<- read.table("histo_data.txt", header=T)
>
> barplot(histo$Value)
>
>
> Usually, I would run each script separately, and put the two resulting
> diagrams together using Adobe Illustrator.  I was wondering if there is a
> way to put these two diagrams together in R, instead of going through the
> manual procedures.  I am currently using R version 2.11.1 on Mac OS X 10.6.
> The actual data used to generate the diagrams are attached in this message.
> Thank you very much in advance.
>
>   Sincerely,
>
>     Young



More information about the R-UG-Ottawa mailing list