Skip to content

simple script help

2 messages · Nathalie Conte, R. Michael Weylandt

#
HI,


I have subsetted a list of exons and put them in a vector exon_list
 > exon_list=levels(test5$V1)

 I want to loop using that vector to create a big pdf which will contain 
all my barplots  and doing this I got only the last  element in my 
exon_list plotted rather than all of them, I guess this is a silly 
newbie mistake, could any of you help?
another point, how to put a numerical scale on X axis in barplot?

 > for (i in exon_list){
+ pdf(file="test.pdf", width=30, height=30, pointsize=36)
+ barplot(uniq5[ which(uniq5$V1==i), ]$V5, main=i)
+
+ dev.off()
+
+
+ }

thanks a lot
Nathalie
#
Put pdf() before your loop and dev.off() after -- as it stands now, on
each iteration you re-open the pdf and thereby wipe everything that
was previously on it.

For the axis, look at the axis() command if you want something
detailed or the xaxt, xlab arguments to boxplot if its relatively
simple.

Michael
On Wed, Nov 16, 2011 at 10:54 AM, Nathalie Conte <nac at sanger.ac.uk> wrote: