| frame_overlap | R Documentation |
Finds, for every establishment of a list frame, the cell of the area
frame it falls in, and marks its domain: "ab" when it lies in a cell of
the frame (it can be reached through the area sample as well), "b"
otherwise. The cells get the count and the names of the listed
establishments inside them, which is what field teams need to screen the
overlap out of the area sample (the screening design) or what
dual_frame_estimator() needs as domains.
frame_overlap(list, cells, cell_size = 1, coords = NULL, pairs = NULL)
list |
Data frame of the list frame with a column |
cells |
The area frame as in |
cell_size |
Side of the square cells, in the unit of the coordinates (ignored for polygons). |
coords |
Names of the coordinate columns in both tables. |
pairs |
Optional data frame with columns |
Locations are matched with coordinates: square cells of side cell_size
around the cell centres (the columns coords), or exact polygons when
cells and list are sf objects (the sf package is then used). A
table of pairs from record linkage (for example from the reclin2
package) can add or override matches: rows with the list unit and the
cell it belongs to.
A list with list (the list frame with columns cell and
domain) and cells (the area frame with columns listed, the number
of listed establishments inside, and listed_units, their names).
cells <- expand.grid(x = 1:5, y = 1:5)
cells$unit <- paste0("c", 1:25)
farms <- data.frame(unit = c("f1", "f2", "f3"), x = c(1.2, 3.4, 9), y = c(1.1, 2.6, 9))
ov <- frame_overlap(farms, cells, cell_size = 1)
ov$list
ov$cells[ov$cells$listed > 0, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.