[R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread katarv
Hi, I have a large data set that I input as a matrix, where I have 1:x rows with names AX, then x+1: y rows named AY, etc. The idea is that I have to count how many rows exactly I have with name AX and how many I have with name AY (or find which row numbers have names AX). Is there any way in R

[R] remove multiple objects starting with same name

2012-02-24 Thread katarv
Hi, I'm trying to figure out syntax R function rm() needs to remove all objects starting with same name. For example, if I have object1, object2, object3, i want to do an operation similar to UNIX rm object* Thanks. -- View this message in context: http://r.789695.n4.nabble.com/remove-multi

[R] Store elements in a list in a triple for loop

2011-07-23 Thread katarv
Hi, I have a triple loop that goes through all elements of a list Lst[[k]][[i,j]] and I want to pick only elements of Lst[[k]][[i,j]] > 0.4 or any value. Then I want to store the values of Lst[[k]][[i,j]] together with their i,j,k values in another list. Say I have Lst[[2]][[4,7]] = 0.6, I wan

Re: [R] 4D data acsess

2011-06-29 Thread katarv
Hi Sarah, I use readMat function, from R.matlab function. str(X) tells that X : num [1:64, 1:64, 1:21, 1:300] as I said, the first 3 columns are x,y,z coordinates. And I need all values in the last column correcponding to a given (x,y,z) coordinate. if you list the values of X, then they ar