I wrote first cut at unirootR for Martin M and he revised and put in
Rmpfr.
The following extends Ben's example, but adds the unirootR with trace
output.
c1 <- 4469.822
c2 <- 572.3413
f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1))
uniroot(f, c(1e-6, 1))
library(Rmpfr)
unirootR(f, c
On 18/02/2023 9:51 a.m., Duncan Murdoch wrote:
One more comment:
The utils::setBreakpoint() function should be updated to be able to set
breakpoints in S7 methods, or a substitute function should be added to
the S7 package.
RStudio 2022.12.0+353 (not sure if that's the latest) also needs to be
c1 <- 4469.822
c2 <- 572.3413
f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1))
uniroot(f, c(1e-6, 1))
provides a root at -6.00e-05, which is outside of the specified
bounds. The default value of the "extendInt" argument to uniroot() is
"no", as far as I can see ...
$root
[1]
One more comment:
The utils::setBreakpoint() function should be updated to be able to set
breakpoints in S7 methods, or a substitute function should be added to
the S7 package.
RStudio 2022.12.0+353 (not sure if that's the latest) also needs to be
taught how to do that, since it doesn't seem
I hadn't been aware of the S7 project, but I've read some of the online
docs about it. It looks like a nice evolution of S3 & S4. I have a few
questions:
Is the proposal is that these patches be included in the upcoming R 4.3.0?
One minor thing missing from the docs (as far as I could see) is
lm works with difftime objects but then if you try to get the summary
it fails with an error:
fit <- lm(as.difftime(Time, units = "mins") ~ demand, BOD)
summary(fit)
## Error in Ops.difftime((f - mean(f)), 2) :
## '^' not defined for "difftime" objects
A number of other lm methods also f