"a" looks pretty short to me, just two elements.

You should spend some (more) time reading the "Introduction to R" document that 
is supplied with the software... particularly the parts on indexing.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnew...@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

"李红旺" <hongwan...@sjtu.edu.cn> wrote:

>> a<-c(1,4)
>> a
>[1] 1 4
>> b<-a*5
>> b
>[1] 5 20
>
>a is a very long vector , how can i get c(1:5,4:20)? i do not want to
>use a loop.
>
>thanks very much!
>
>______________________________________________
>R-help@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.

______________________________________________
R-help@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.

Reply via email to