[R] for loop using index values

David Winsemius dwinsemius at comcast.net
Thu May 15 06:49:07 CEST 2014


On May 14, 2014, at 9:23 PM, David Gwenzi wrote:

> Hi all
>
> I have point data along a transect and I want to divide the transect  
> into
> small blocks of 10m length each. I have named the blocks as a list i.e
> subset[[i]]. Now the issue is I want to process only those blocks  
> that have
> at least 100 data points and keep the original index values of those
> subsets. How do I set the for loop. I have tried the following but  
> it is
> still processing everything
>
> select<-which(nrow(subset[[i]])>=100
> for (i in c(select)){
> ..............
> }
> Thank you in advance,

So can you provide str( subset[[1]] )?


>
> David Gwenzi
> Graduate Degree Program in Ecology
> Natural Resources Ecology Lab
> Colorado State University
>
> 	[[alternative HTML version deleted]]

And this is a plain text mailing list as described in the Posting Guide.

-- 

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list