[R] conditional across frames of a data fram

From: Jason Vytlacil <jason.vytlacil_at_gmail.com>
Date: Fri, 11 May 2007 14:14:02 -0700


  I'm a newbie, so please forgive me:

I have a data frame that includes two long columns of x and y coordinate values thusly:
... ... ... x y ... ...
... ... ... 115 127 ... ...
... ... ... 120 129 ... ...
... ... ... 0 0 ... ...
... ... ... 135 162 .... ...
ect...

  i need to ask R tell me how many x-y pairs contain coords that are non-zero and fall within values that i'm callilng xleft, xright, ybottom and ytop and fall between certain indicies of the data frame. i am calling the indexes by referring to numbers i have storied in other variables. i am really looking for an efficient way to do this since when i try to pull the x and y columns out and assign them to their own variables, the process of asking for the number of non-zeros which have x values such that xleft <= x <= xright AND ybottom <= y <=ytop, the process becomes very convoluted. how can i ask for more than one conditional at once?   thanks for any help,
  jason

        [[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 and provide commented, minimal, self-contained, reproducible code. Received on Fri 11 May 2007 - 21:20:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 May 2007 - 02:31:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.