Re: [R] Run function several times changing only one argument - without a loop

2012-02-20 Thread David Winsemius
On Feb 20, 2012, at 5:04 AM, Marion Wenty wrote: Dear people, I created a plot which looks like this: Ee1<-matrix(c(88,86,74,62,41),ncol=5) colnames(Ee1)<- c ("Lehrer ","Lehrerinnen","Klassenkollegen","Klassenkolleginnen","Geschwister") par(las=1) par(mar=c(5,13,4,2)) barplot(Ee1,horiz=T,

Re: [R] Run function several times changing only one argument - without a loop

2012-02-20 Thread Marion Wenty
Hi Enrico, Yes, you were right, I just wanted to draw white vertical lines and with your command it's much simpler. Thanks a lot! Hi Eik, I learned a lot from your tips about sapply and Vectorize! I had only used apply, lapply and mapply but not yet sapply. I find the Vectorize function very fasci

Re: [R] Run function several times changing only one argument - without a loop

2012-02-20 Thread Eik Vettorazzi
Hi Marion, you can either use any of the *apply-functions or vectorize your function (which internally uses mapply): par(las=1) par(mar=c(5,13,4,2)) barplot(Ee1,horiz=T,col="grey85",border="NA",xlim=c(0,100),axes=F) #using sapply invisible(sapply((1:9)*10,function(x)axis(2,pos=x,tick=T, tcl=F, la

Re: [R] Run function several times changing only one argument - without a loop

2012-02-20 Thread Enrico Schumann
Hi Marion, is all you want the white vertical lines? Then try abline(v = seq(10, 90, by = 10), col = "white") instead of your axis commands. Regards, Enrico Am 20.02.2012 11:04, schrieb Marion Wenty: Dear people, I created a plot which looks like this: Ee1<-matrix(c(88,86,74,62,41),ncol=

[R] Run function several times changing only one argument - without a loop

2012-02-20 Thread Marion Wenty
Dear people, I created a plot which looks like this: Ee1<-matrix(c(88,86,74,62,41),ncol=5) colnames(Ee1)<-c("Lehrer","Lehrerinnen","Klassenkollegen","Klassenkolleginnen","Geschwister") par(las=1) par(mar=c(5,13,4,2)) barplot(Ee1,horiz=T,col="grey85",border="NA",xlim=c(0,100),axes=F) axis(2,pos=10