Skip to content

Commit

Permalink
Solves "Error in eval(predvars, data, env) : object 'hgt_z_0' not fou…
Browse files Browse the repository at this point in the history
…nd". Added test code and dependency to chartplotter 0.32.0, resolved issue #23
  • Loading branch information
stefvanbuuren committed Mar 15, 2024
1 parent f7b3402 commit 6fa49ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Imports:
bdsreader (>= 0.24.2),
chartbox (>= 1.15.0),
chartcatalog (>= 1.14.0),
chartplotter (>= 0.31.2),
chartplotter (>= 0.32.0),
dplyr,
curl,
grDevices,
Expand Down
8 changes: 4 additions & 4 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@
},
"chartplotter": {
"Package": "chartplotter",
"Version": "0.31.2",
"Version": "0.32.0",
"Source": "GitHub",
"RemoteType": "github",
"Remotes": "growthcharts/bdsreader, growthcharts/centile, growthcharts/chartbox, growthcharts/chartcatalog, growthcharts/curvematching, growthcharts/jamesdemodata, growthcharts/nlreferences, growthcharts/donorloader",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteRepo": "chartplotter",
"RemoteUsername": "growthcharts",
"RemoteRef": "HEAD",
"RemoteSha": "a385ccb95757c0c9ed84e701e076b3061318a2d3",
"RemoteSha": "cc5b0118b065f82b07529d613a83c274806ab623",
"Requirements": [
"R",
"brokenstick",
Expand All @@ -340,7 +340,7 @@
"tidyr",
"utils"
],
"Hash": "1227b55b54c2b0917ffd5de5c0044231"
"Hash": "505abf6bd969065c3ffdd3276d659439"
},
"cli": {
"Package": "cli",
Expand Down
19 changes: 19 additions & 0 deletions tests/testthat/test-draw_chart.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# curvematching problem
# Error in eval(predvars, data, env) : object 'hgt_z_0' not found


# the following code gave: Error in eval(predvars, data, env) : object 'hgt_z_0' not found
# chartplotter 0.32.0 resolved this error
library(jamesclient)
fn <- path.expand("~/Package/james/notes/Voorbeelddossier.txt")
js <- read_json_js(fn)
test_that("Matches do not condition on yname when there are no brokenstick estimates", {
expect_silent(james::draw_chart(
txt = js, chartcode = c(""),
selector = c("derive"), chartgrp = c("preterm"), agegrp = c("0-15m"),
sex = c("female"), etn = c("nl"), ga = 27L, side = c("hgt"),
curve_interpolation = TRUE, quiet = TRUE, dnr = c("0-2"),
lo = "4w", hi = c("14m"), nmatch = 10L, exact_sex = TRUE,
exact_ga = FALSE, show_future = FALSE, show_realized = FALSE,
draw_grob = FALSE))
})

0 comments on commit 6fa49ab

Please sign in to comment.