Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 210554

How to index coordinate data according to a grid in R?

$
0
0

I have coordinate data (x-coordinates and y-coordinates) on a scale between:Xpos: 27-1367nm, Ypos: 67-1014nm. A data set consists of about 2500-3500 data points.Here is the header of such a data set:

   XPos YPos1    29  2112    31  6093    33 10014    35  5085    37  4246    39  5847    40  3788    41  2049    41  44410   41  872 ...

[![Data plotted][1]][1]

Now I would like to index the data points by applying a grid consisting of equal sized quadrants onto the data in R. The result should be a new column "grid_index" containing a unique quadrant_ID in which the data points are located (see image). Is there an easy way to do this? I would like to try different grid unit sizes to partition the data e.g. quadrants sized 50nm, 100nm, 200nm or 400nm and rectangles sized 100nm x 200nm or 50nm x100nm.

[![Grid for data pint indexing][2]][2]

[![Each grid quadrant should have an unique ID][3]][3]

I would be very grateful for any help.


Viewing all articles
Browse latest Browse all 210554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>