Skip to content

Commit 35ec952

Browse files
committed
Remove pipe placeholder at the end of a chain of extractions, which would require dependency on R >= 4.3.0
1 parent e3db58f commit 35ec952

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

R/build_aggregation_table.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ build_aggregation_table <- function(
113113
ID = TRUE
114114
) |>
115115
data.table::as.data.table() |>
116-
data.table::setnames(c('dummy_id', 'pixel_id', 'area_fraction')) |>
117-
_[, polygon_id := sapply(dummy_id, function(x) poly_ids[x])] |>
118-
_[, dummy_id := NULL]
116+
data.table::setnames(c('dummy_id', 'pixel_id', 'area_fraction'))
117+
(agg_table
118+
[, polygon_id := sapply(dummy_id, function(x) poly_ids[x])])[, dummy_id := NULL]
119+
[, dummy_id := NULL]
120+
)
119121

120122
# Merge on 'masked_pixel_id'
121123
masked_pixel_table <- data.table::data.table(

0 commit comments

Comments
 (0)