Skip to content

Commit

Permalink
thinning by 600 and iteration list final
Browse files Browse the repository at this point in the history
  • Loading branch information
wlangera committed Jan 8, 2024
1 parent 1a2f87e commit 59eee99
Show file tree
Hide file tree
Showing 6 changed files with 1,353 additions and 104 deletions.
1,351 changes: 1,298 additions & 53 deletions source/targets/mas_steekproef_zn_lm/_targets/meta/meta

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ list(
tar_target(
name = steekproefkader_finaal,
command = add_stratum_sbp(
punten_sf = do.call(rbind.data.frame, plus_openheid_landschap),
sbp = do.call(rbind.data.frame, sbp_akkervogels),
punten_sf = plus_openheid_landschap,
sbp = do.call(rbind.data.frame, sbp_akkervogels)
),
pattern = map(plus_openheid_landschap)
pattern = map(plus_openheid_landschap),
iteration = "list"
)
)
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
list(
tarchetypes::tar_map(
list(thin_dists = c(300, 600)),
tar_target(
steekproef_thinned,
thin_sample(
sample = steekproef,
thin_dist = thin_dists
),
pattern = map(steekproef)
),
tar_target(
steekproef_final,
replace_by_existing(
sample = steekproef_thinned,
existing_points = existing_data,
overlap_prop = 0.5,
sbp_file = sbp_akkervogels
),
pattern = map(steekproef_thinned)
)
tar_target(
steekproef_thinned,
thin_sample(
sample = steekproef,
thin_dist = 600
),
pattern = map(steekproef),
iteration = "list"
),
tar_target(
steekproef_final,
replace_by_existing(
sample = steekproef_thinned,
existing_points = existing_data,
overlap_prop = 0.5,
sbp_file = do.call(rbind.data.frame, sbp_akkervogels)
),
pattern = map(steekproef_thinned),
iteration = "list"
)
)

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ list(
),
tarchetypes::tar_group_by(
steekproefkader_per_stratum,
steekproefkader_finaal %>%
do.call(rbind.data.frame, steekproefkader_finaal) %>%
semi_join(allocatie_df %>%
select(Naam, is_sbp, openheid_klasse),
by = c("Naam", "is_sbp", "openheid_klasse")),
Expand All @@ -41,6 +41,7 @@ list(
sample_size_multiplication = 1,
balance = c("X", "Y", "area_prop_sb")
),
pattern = map(steekproefkader_per_stratum, allocatie_per_stratum)
pattern = map(steekproefkader_per_stratum, allocatie_per_stratum),
iteration = "list"
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ list(
output_finaal(
files = list(steekproefkader = steekproefkader_finaal,
steekproef = steekproef_final_600),
write_out = TRUE
write_out = FALSE
)
)
)
52 changes: 27 additions & 25 deletions source/targets/mas_steekproef_zn_lm/targets_steekproef_zn_lm.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,10 @@ list(
name = steekproefkader_finaal,
command = add_stratum_sbp(
punten_sf = plus_openheid_landschap,
sbp = sbp_akkervogels
sbp = do.call(rbind.data.frame, sbp_akkervogels)
),
pattern = map(plus_openheid_landschap)
pattern = map(plus_openheid_landschap),
iteration = "list"
)
)
```
Expand Down Expand Up @@ -392,7 +393,7 @@ list(
),
tarchetypes::tar_group_by(
steekproefkader_per_stratum,
steekproefkader_finaal %>%
do.call(rbind.data.frame, steekproefkader_finaal) %>%
semi_join(allocatie_df %>%
select(Naam, is_sbp, openheid_klasse),
by = c("Naam", "is_sbp", "openheid_klasse")),
Expand All @@ -407,35 +408,36 @@ list(
sample_size_multiplication = 1,
balance = c("X", "Y", "area_prop_sb")
),
pattern = map(steekproefkader_per_stratum, allocatie_per_stratum)
pattern = map(steekproefkader_per_stratum, allocatie_per_stratum),
iteration = "list"
)
)
```

```{targets nabehandeling}
list(
tarchetypes::tar_map(
list(thin_dists = c(300, 600)),
tar_target(
steekproef_thinned,
thin_sample(
sample = steekproef,
thin_dist = thin_dists
),
pattern = map(steekproef)
),
tar_target(
steekproef_final,
replace_by_existing(
sample = steekproef_thinned,
existing_points = existing_data,
overlap_prop = 0.5,
sbp_file = sbp_akkervogels
),
pattern = map(steekproef_thinned)
)
tar_target(
steekproef_thinned,
thin_sample(
sample = steekproef,
thin_dist = 600
),
pattern = map(steekproef),
iteration = "list"
),
tar_target(
steekproef_final,
replace_by_existing(
sample = steekproef_thinned,
existing_points = existing_data,
overlap_prop = 0.5,
sbp_file = do.call(rbind.data.frame, sbp_akkervogels)
),
pattern = map(steekproef_thinned),
iteration = "list"
)
)
```

```{targets version-control}
Expand All @@ -445,7 +447,7 @@ list(
output_finaal(
files = list(steekproefkader = steekproefkader_finaal,
steekproef = steekproef_final_600),
write_out = TRUE
write_out = FALSE
)
)
)
Expand Down

0 comments on commit 59eee99

Please sign in to comment.