Re: [R] how to delete a matrix column

2012-06-17 Thread Ted Harding
On 17-Jun-2012 17:24:21 ÀîºìÍú 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! Your question is not quite clear, but I think you mean: a is a very long vector, and you wa

Re: [R] how to delete a matrix column

2012-06-17 Thread Petr Savicky
On Mon, Jun 18, 2012 at 01:24:21AM +0800, 李红旺 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. Hi. How large are the numbers in a? If max(a) is not too large, try the following. a <- c(1, 4

Re: [R] how to delete a matrix column

2012-06-17 Thread Jeff Newmiller
"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

Re: [R] how to delete a matrix column

2012-06-17 Thread 李红旺
> 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 posti