Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot the natural curve for extrapolation also in the negative quadrant #552

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ speed boost. The default setting can be overridden via the `rprime` argument
use to find a good starting point failed: in such cases, we try again using
the simulated fit (#549, fixed in #500; thanks to @SalOehl for reporting and
providing data to reproduce the error).
* The natural/simulated curve was not plotted in the negative quadrant for
`mode = "extrapolation"`, which made it harder to see where it extrapolated
to (#551, fixed in #552; thanks to @SalOehl for reporting).


### `calc_IEU()`
* The code of this function has been consolidated to avoid duplication and
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@
model we use to find a good starting point failed: in such cases, we
try again using the simulated fit (#549, fixed in \#500; thanks to
@SalOehl for reporting and providing data to reproduce the error).
- The natural/simulated curve was not plotted in the negative quadrant
for `mode = "extrapolation"`, which made it harder to see where it
extrapolated to (#551, fixed in \#552; thanks to @SalOehl for
reporting).

### `calc_IEU()`

Expand Down
9 changes: 7 additions & 2 deletions R/calc_Huntley2006.R
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,14 @@ calc_Huntley2006 <- function(
col = adjustcolor("grey", alpha.f = 0.5), border = NA)

## add simulated curve -------
xNew <- seq(if (mode_is_extrapolation) par()$usr[1] else 0,
par()$usr[2], length.out = 200)
yNew <- predict(GC.simulated@data$Fit, list(x = xNew))
if (normalise)
yNew <- yNew / A
points(
x = natdosetimeGray,
y = LxTx_simulated$LxTx,
x = xNew,
y = yNew,
type = "l",
lty = 3)

Expand Down
Loading