Skip to content

Commit

Permalink
add medal to farm output object
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardhros committed Jun 14, 2022
1 parent 7bd6acf commit 18e35c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- internal table `bbwp_measures` with column bbwp_conflict
- avoid additive scoring for conflicting measures in `bbwp_meas_score` and `bbp_meas_rank`
- avoid additive scoring for conflicting measures in `er_meas_score`
- add `er_medal` as farm output for `ecoregeling`
- tests are updated

## 0.5.0
Expand Down
3 changes: 3 additions & 0 deletions R/er_main.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ ecoregeling <- function(B_SOILTYPE_AGR, B_LU_BRP, B_LU_BBWP,B_GWL_CLASS, B_SLOPE
# Add field id
setnames(dt.fields,'id','field_id')

# add fake medal for the moment
dt.farm$er_medal <- 'silver'

# set output object
out <- list(farm = as.list(dt.farm),fields = dt.fields)

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-er.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ test <- ecoregeling(B_SOILTYPE_AGR = c('dekzand', 'loess', 'rivierklei'),

test_that("check ecoregeling", {
expect_equal(
object = as.numeric(unlist(test$farm)),
expected = c(6,9,6,11,6,0,460),
object = as.character(unlist(test$farm)),
expected = c(6,9,6,11,6,0,460,'silver'),
tolerance = 0.01)
})

Expand Down Expand Up @@ -99,8 +99,8 @@ test <- ecoregeling(B_SOILTYPE_AGR = c('dekzand', 'loess', 'rivierklei'),

test_that("check ecoregeling", {
expect_equal(
object = as.numeric(unlist(test$farm)),
expected = c(23,23,27,51,16,15,802),
object = as.character(unlist(test$farm)),
expected = c(23,23,27,51,16,15,802,'silver'),
tolerance = 0.01)
})

Expand Down

0 comments on commit 18e35c5

Please sign in to comment.