Super, thanks a lot!! I didn't think about using names()
Ivan
Le 1/19/2010 17:35, Carlos Ortega a écrit :
> OK.
> For the names of the variables you can include this code in the loop
> (variable nv):
>
>
> seq.dat<-c(seq(7,10,1), seq(12,17,1))
> for( i in 1:length(seq.dat) ) {
>
> j<-seq.dat[i]
OK.
For the names of the variables you can include this code in the loop
(variable nv):
seq.dat<-c(seq(7,10,1), seq(12,17,1))
for( i in 1:length(seq.dat) ) {
j<-seq.dat[i]
nv<-names(ssfa)[j]
with( ssfa, twoplots(TO_POS, ssfa[[j]], nv) )
}
And this modification in the function (nm):
#defines
Thank you for your answer, I got the second part!
Ivan
Le 1/19/2010 17:03, Carlos Ortega a écrit :
> Hello,
>
> You can loop in the subset you need by storing in a variable and
> looping on that variable with indexes:
>
> seq.dat<-c(seq(7,10,1), seq(12,17,1))
> for( i in 1:length(seq.dat) ) {
>
Hello,
You can loop in the subset you need by storing in a variable and looping on
that variable with indexes:
seq.dat<-c(seq(7,10,1), seq(12,17,1))
for( i in 1:length(seq.dat) ) {
j<-seq.dat[i]
with(ssfa, twoplots(TO_POS, ssfa[[j]]))
}
Regards,
Carlos.
On Tue, Jan 19, 2010 at 4:53 PM, Ivan C
Hi again!
I feel like I cannot do anything by myself but I would now like to plot
for all numeric variables I have (14 of them). I wanted to add a loop then.
The code is:
--
#defines the function for the plots (as written by Duncan Murdoch)
twoplots <- function(x, y) {
ylab <- deparse(subs
5 matches
Mail list logo