[R] Subsetting a square marix

Tawanda Tarakini tawandatizora at gmail.com
Tue Jan 5 10:06:52 CET 2016


I have a global matrix (e.g. table below) of species feeding. I am trying
to create specific matrix for specific sites. If for example a subset is to
have sp1, sp3 and spp only these 3 species should be appearing in the
subset (both column and rows).

I have been checking online help but I seem not to get my scenario



Sp1

Sp2

Sp3

Sp4

Sp5

Sp6

Sp1

0

0

1

0

0

0

Sp2

1

0

0

0

1

0

Sp3

0

0

0

1

0

0

Sp4

0

1

0

1

0

0

Sp5

0

0

1

0

0

0

Sp6

0

0

0

1

1

0

-- 
Kind Regards

Tawanda Tarakini

Lecturer and Industrial attachment coordinator
Department of Wildlife, Ecology and Conservation
Chinhoyi University of Technology
Bag 7724, Chinhoyi
Cell: +263 775 321 722
Alternative email: ttarakini at cut.ac.zw

	[[alternative HTML version deleted]]



More information about the R-help mailing list