You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @param data: point data (lat, lon) or a shapefile containing shapes (polygons, lines, etc.)
7
7
#' @param target: shapefile containing shapes (polygons, lines, etc.). This is for the target boundaries/geographic levels (assumes larger than the starting level I think).
8
-
#' @param location_columns: required for points (e.g c("LATITUDE", "LONGITUDE") or c("lat", "lon") depending on data format), not required for shapefile data.
8
+
#' @param location_columns: required for points (e.g c("LONGITUDE", "LATITUDE") or c("lon", "lat") depending on data name format), not required for shapefile data.
9
9
#' @param extensive: TRUE if data of interest is spatially extensive, (e.g population) or FALSE if spatially intensive (e.g population density)
10
10
#' @param join_method: in the case of shapefile to shapefile (multipoint and polygons, not points) crosswalks, choose "max_area"
11
11
#' or "areal-weighted" to inherit values of source data based on maximum intersection or a area-weighted average
12
12
#' of all intersecting polygons. NULL in other cases, where the mean is taken by default.
13
13
#' @output
14
14
#' Returns a joined dataset on the target scale (a shapefile).
#' @param data: point data (lat, lon) or a shapefile containing shapes (polygons, lines, etc.)
6
6
#' @param target: shapefile containing shapes (polygons, lines, etc.). This is for the target boundaries/geographic levels (assumes larger than the starting level I think).
7
-
#' @param location_columns: required for points (e.g c("LATITUDE", "LONGITUDE") or c("lat", "lon") depending on data format), not required for shapefile data.
7
+
#' @param location_columns: required for points (e.g c("LONGITUDE", "LATITUDE") or c("lon", "lat") longitude first, latitude second). Not required for shapefile data.
8
8
#' @param extensive: TRUE if data of interest is spatially extensive, (e.g population) or FALSE if spatially intensive (e.g population density)
9
9
#' @param join_method: in the case of shapefile to shapefile (multipoint and polygons, not points) crosswalks, choose "max_area"
10
10
#' or "areal-weighted" to inherit values of source data based on maximum intersection or a area-weighted average
#' Point data is maintained as points. User must rasterize resulting dataframe if they want the output of a point/raster join to be in raster form.
18
18
#' Raster/shapefile combinations will output a shapefile, not a raster. User must rasterize polygon data if they want the output to be a raster.
19
19
#' Raster/raster combinations take the mosaic mean of the two files. The output is a raster. Users must combine with another shapefile if they want a shapefile output.
#' @param data: data on the source geographic scale. Can be a shapefile, raster, or in the case of point data, a table with lat/lon columns.
14
14
#' point data (lat, lon) or a shapefile containing shapes (polygons, lines, etc.). For point data crosswalking to a target polygon geometry, data is maintained on the point scale and assigned to a geometry (requires users to perform aggregation of choice outside the function
15
15
#' @param target: shapefile containing shapes (polygons, lines, etc.). This is for the target boundaries/geographic levels.
16
-
#' @param location_columns: only required for points (e.g c("LATITUDE", "LONGITUDE") or c("lat", "lon") depending on data format), not required for shapefile or raster data.
16
+
#' @param location_columns: only required for points (e.g ("LONGITUDE", "LATITUDE") or c("lon", "lat"), longitude first and latitude second). Not required for shapefile or raster data.
17
17
#' @param extensive: TRUE if data of interest is spatially extensive, (e.g population, function = SUM) or FALSE if spatially intensive (e.g population density, function = MEAN).
18
18
#' @param join_method: in the case of shapefile to shapefile (multipoint and polygons, not points) crosswalks, choose "max_area"
19
19
#' or "areal_weighted" to inherit values of source data based on maximum intersection assignment or a area-weighted average/sum
#' Returns a shapefile on the target scale (except raster/raster combinations, which output a stacked raster). Please check that your data is correctly aggregated and adjust input parameters as needed.
23
23
#' @Notes
24
24
#' Relies on functions crosswalk_geom.R (data, target, location_columns, extensive, join_method) and crosswalk_raster.R (data, target, location_columns, extensive).
25
+
#'
25
26
#' This function will automatically detect geometry columns associated with shapefiles.
27
+
#'
28
+
#' Please be mindful of NA values prior to performing spatial crosswalks/joins. When taking areal-weighted averages and sums, all target geometries will be maintained even
29
+
#' if the resulting interpolation is NA. Prior to calculating the interpolation, NA values in the source data will be removed so as to not cause calculations to return NA. You will need to check your NAs and handle them in the way you see appropriate before using the crosswalked data output by this function.
30
+
#'
31
+
#' When assigning points to shapes, all points will be returned with their associated shapes (left join where points are maintained). When assigning point values to a raster, you will end up with a polygonized raster with appended values for points contained by the raster squares.
32
+
#'
33
+
#'
26
34
#' Notes on using raster data in combination with other data:
27
35
#' Point data is set on the raster scale but maintains its original values. NA values for polygonized rasters not containing a point. Will double count polygons containing multiple points.
28
36
#' Raster/shapefile combinations will output a shapefile, not a raster. User must rasterize polygon data if they want the output to be a raster.
29
37
#' Raster/raster combinations stack the two files to be a stacked raster object. The output is a stacked raster. Users must combine with another shapefile if they want a shapefile output.
0 commit comments