Skip to content

Commit 2dae941

Browse files
committed
polish example
1 parent 6a3266f commit 2dae941

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

R/aggregate.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ aggregate.sf = function(x, by, FUN, ..., do_union = TRUE, simplify = TRUE,
133133
#' # dasymetric mapping
134134
#' bir.grd = st_interpolate_aw(nc[c("BIR74","BIR79")], extensive = TRUE, grd.addr, weights = "ones")
135135
#' xbir.grd = bir.grd # copy for plotting
136-
#' xbir.grd$BIR74[xbir.grd$BIR74 == 0] = 1 # so that logz shows finite values
136+
#' smallest_pos = function(x) min(x[x > 0])
137+
#' xbir.grd$BIR74[xbir.grd$BIR74 == 0] = smallest_pos(xbir.grd$BIR74) # so that logz shows finite values
137138
#' \donttest{plot(xbir.grd["BIR74"], logz = TRUE, main = "dasym. redistributed birth counts, 1974-")}
138139
#' # verify sums:
139140
#' apply(as.data.frame(bir.grd)[1:2], 2, sum)

man/interpolate_aw.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)