[R] how to delete a matrix column

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Sun Jun 17 21:22:18 CEST 2012


"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:<jdnewmil at 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.

"李红旺" <hongwangli at 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 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.



More information about the R-help mailing list