getPolygonData | R Documentation |
Function to Extract polygon id and response data into a data.frame from a sf object Taken from disaggregation package Returns a data.frame with a row for each polygon in the sf object and columns: area_id, response and N, containing the id of the polygon, the values of the response for that polygon, and the sample size respectively. If the data is not survey data (the sample size does not exist), this column will contain NAs.
getPolygonData(
shape,
id_var = "area_id",
response_var = "response",
sample_size_var = NULL
)
shape |
A sf object containing response data. |
id_var |
Name of column in shape object with the polygon id. Default 'area_id'. |
response_var |
Name of column in shape object with the response data. Default 'response'. |
sample_size_var |
For survey data, name of column in sf object (if it exists) with the sample size data. Default NULL. |
A data.frame with a row for each polygon in the sf object and columns: area_id, response and N, containing the id of the polygon, the values of the response for that polygon, and the sample size respectively. If the data is not survey data (the sample size does not exist), this column will contain NAs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.