Skip to content

Commit

Permalink
Add od_disag args to od_jitter for #39
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Dec 5, 2021
1 parent 41de756 commit 4b6a3e2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
20 changes: 14 additions & 6 deletions R/jitter.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@
#' # plot(od_sf[od$all > 200, 1])
#' # plot(dlr3[od$all > 200, 1])
#' # mapview::mapview(od_sf$geometry[od$all > 200])
od_jitter = function(od,
z,
zd = NULL,
subpoints_o = NULL,
subpoints_d = NULL) {
od_jitter = function(
od,
z,
zd = NULL,
subpoints = NULL,
code_append = "_ag",
population_column = 3,
max_per_od = 5,
keep_ids = TRUE,
integer_outputs = FALSE,
# od_jitter-specific arguments (and zd)
subpoints_o = NULL,
subpoints_d = NULL
) {
if (!methods::is(od, "sf")) {
# the data structure to reproduce for matching OD pairs
od = od::od_to_sf(od, z = z, zd = zd)
Expand All @@ -75,7 +84,6 @@ od_jitter = function(od,
od = sf::st_drop_geometry(od)
odc_df = data.frame(o = od[[1]], d = od[[2]], odc_original)
z_geo = sf::st_geometry(z)
# browser()
id_origins = od[[1]]
points_per_zone = data.frame(table(id_origins))
names(points_per_zone)[1] = names(z)[1]
Expand Down
32 changes: 31 additions & 1 deletion man/od_jitter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b6a3e2

Please sign in to comment.