search for: matd

Displaying 1 result from an estimated 1 matches for "matd".

Did you mean: mat
2006 Sep 20
1
how to delete some columns from a matrix based on some other indicator variable
Hello, I am not very familiar with R and need help in deleting a few columns in a matrix. Suppose I have a indicator variable called r and it's defined as r = (0, 0, 1, 1). A matrix D is a 3X4 matrix. If I want a new matrix which contains only the columns of D corresponding to the elements of r that equal to 1. how can i write a loop which creat a new matrix that contains only the last