Skip to content

Commit

Permalink
fixing sprintf statement when time is not an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
kkholst committed Jan 9, 2025
1 parent d9edf9e commit 1fa3404
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions R-package/targeted/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ importFrom(stats,approxfun)
importFrom(stats,as.formula)
importFrom(stats,binomial)
importFrom(stats,coef)
importFrom(stats,cov2cor)
importFrom(stats,delete.response)
importFrom(stats,density)
importFrom(stats,deriv)
Expand All @@ -131,11 +132,13 @@ importFrom(stats,model.offset)
importFrom(stats,model.response)
importFrom(stats,na.pass)
importFrom(stats,nlminb)
importFrom(stats,pchisq)
importFrom(stats,predict)
importFrom(stats,quantile)
importFrom(stats,reformulate)
importFrom(stats,runif)
importFrom(stats,terms)
importFrom(stats,uniroot)
importFrom(stats,update)
importFrom(stats,vcov)
importFrom(stats,weighted.mean)
Expand Down
4 changes: 2 additions & 2 deletions R-package/targeted/R/targeted-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
##' lm.wfit lm.fit glm lm coef vcov model.frame model.matrix na.pass nlminb
##' predict dnorm quantile terms weighted.mean runif .getXlevels
##' delete.response model.response gaussian formula model.offset reformulate
##' drop.terms weights model.extract
##' drop.terms weights model.extract cov2cor pchisq uniroot
##' @importFrom rlang hash call_match
##' @importFrom optimx optimx
##' @importFrom data.table data.table is.data.table
Expand All @@ -27,7 +27,7 @@
##' @author Klaus K. Holst (Maintainer) <klaus@@holst.it>
##' @keywords package
##' @examples
##' \dontrun{
##' \dontrun{x
##' example(riskreg)
##' example(cate)
##' example(ate)
Expand Down
4 changes: 2 additions & 2 deletions R-package/targeted/R/truncatedscore.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ truncatedscore_estimate <- function(
est1 <- m1 + mean(ic1)
ic <- cbind(ic, ic1 - mean(ic1))
est <- c(est, est1)
lab0 <- c(lab0, sprintf("E(Y|T>=%d,A=%d)", time, aval))
lab0 <- c(lab0, sprintf("E(Y|T>=%f,A=%s)", time, aval))
}
lab0 <- c(lab0, "diff")
res <- estimate(
Expand All @@ -219,7 +219,7 @@ truncatedscore_estimate <- function(
...
)
lab <- paste0(gsub(
"^treat", sprintf("Risk\\(T<%d|A=", time),
"^treat", sprintf("Risk\\(T<%f|A=", time),
names(b$riskDR)[1:2]), ")")
lab <- c(lab, "riskdiff")
best <- estimate(
Expand Down
2 changes: 1 addition & 1 deletion R-package/targeted/man/targeted-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1fa3404

Please sign in to comment.