[R] subset a matrix
ronggui
ronggui.huang at gmail.com
Wed Apr 12 17:03:18 CEST 2006
> x=matrix(rnorm(20*30),20)
> y=x[seq(1,20,by=2),seq(1,30,by=2)]
2006/4/12, zhijie zhang <epistat at gmail.com>:
> Dear friends,
> I have a (20*30) matrix,and want to get a subset of it like the following:
> The original matrix: rows:1,2,3,....20; columns:1,2,3,....30
> I want to get my subset of The original matrix and delete others:
> rows:1,3,5,7,...19; columns:1,3,5.....29
>
>
> --
> Kind Regards,Zhi Jie,Zhang ,PHDDepartment of EpidemiologySchool of Public
> HealthFudan UniversityTel:86-21-54237149
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
»ÆÈÙ¹ó
Deparment of Sociology
Fudan University
More information about the R-help
mailing list