[R] how to get the varifying character with two variables?

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Sep 1 09:33:06 CEST 2011


See ?outer (use paste as the function, as in one of the examples).

On Thu, 1 Sep 2011, Jie TANG wrote:

> hi R user
> mtdno<-paste("data",1:3,sep="")
> tyno<-paste("obs",1:5,sep="")
> flnm<-paste(mtdno,tyno,"_err.dat",sep="")
>
> flnm  is
> [1] "data1obs1_err.dat" "data2obs2_err.dat" "data3obs3_err.dat"
> [4] "data1obs4_err.dat" "data2obs5_err.dat"
>
> but actually what i want is data from 1 to  3 and obs from 1 to 5. thus ,I
> can read 15 files but not 5 files
>
> how could I  do?
> thanks.
> -- 
> TANG Jie
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list