{
  "_id": "6ac4eeb8f511ae58c09a339f",
  "Package": "drugDemand",
  "Type": "Package",
  "Title": "Drug Demand Forecasting",
  "Version": "0.1.3",
  "Date": "2024-02-27",
  "Authors@R": "person(\"Kaifeng\", \"Lu\", , \"kaifenglu@gmail.com\", role = c(\"aut\", \"cre\"),\ncomment = c(ORCID = \"0000-0002-6160-7119\"))",
  "Description": "Performs drug demand forecasting by modeling drug\ndispensing data while taking into account predicted enrollment\nand treatment discontinuation dates. The gap time between\nrandomization and the first drug dispensing visit is modeled\nusing interval-censored exponential, Weibull, log-logistic, or\nlog-normal distributions (Anderson-Bergman (2017)\n<doi:10.18637/jss.v081.i12>). The number of skipped visits is\nmodeled using Poisson, zero-inflated Poisson, or negative\nbinomial distributions (Zeileis, Kleiber & Jackman (2008)\n<doi:10.18637/jss.v027.i08>). The gap time between two\nconsecutive drug dispensing visits given the number of skipped\nvisits is modeled using linear regression based on least\nsquares or least absolute deviations (Birkes & Dodge (1993,\nISBN:0-471-56881-3)). The number of dispensed doses is modeled\nusing linear or linear mixed-effects models (McCulloch & Searle\n(2001, ISBN:0-471-19364-X)).",
  "License": "GPL (>= 2)",
  "RoxygenNote": "7.3.0",
  "Roxygen": "list(markdown = TRUE)",
  "Encoding": "UTF-8",
  "NeedsCompilation": "yes",
  "Config/pak/sysreqs": "cmake make libicu-dev libuv1-dev libssl-dev\nzlib1g-dev",
  "Repository": "https://kaifenglu.r-universe.dev",
  "Date/Publication": "2024-02-27 23:11:29 UTC",
  "RemoteUrl": "https://github.com/kaifenglu/drugdemand",
  "RemoteRef": "HEAD",
  "RemoteSha": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
  "Packaged": {
    "Date": "2026-10-06 12:45:54 UTC",
    "User": "root"
  },
  "Author": "Kaifeng Lu [aut, cre] (ORCID: <https://orcid.org/0000-0002-6160-7119>)",
  "Maintainer": "Kaifeng Lu <kaifenglu@gmail.com>",
  "_user": "kaifenglu",
  "_type": "src",
  "_file": "drugDemand_0.1.3.tar.gz",
  "_fileid": "https://r2.ropensci.org/76953e4e417449ca9a30281ddd85944a00c9996a28f4a5c5f2349dc9628e3bbe",
  "_filesize": 106626,
  "_sha256": "76953e4e417449ca9a30281ddd85944a00c9996a28f4a5c5f2349dc9628e3bbe",
  "_expires": "2027-01-14T12:51:02.000Z",
  "_created": "2026-10-06T12:45:54.000Z",
  "_published": "2026-10-06T12:51:04.076Z",
  "_jobs": [
    {
      "job": 112276015806,
      "time": 156,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11414044835"
    },
    {
      "job": 112276015597,
      "time": 191,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11413969947"
    },
    {
      "job": 112276015835,
      "time": 147,
      "config": "linux-release-arm64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11413594961"
    },
    {
      "job": 112276015767,
      "time": 184,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11414314916"
    },
    {
      "job": 112276015765,
      "time": 135,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11414655673"
    },
    {
      "job": 112276015659,
      "time": 259,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11414980489"
    },
    {
      "job": 112276015740,
      "time": 173,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11414705716"
    },
    {
      "job": 112276015886,
      "time": 264,
      "config": "macos-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11415215450"
    },
    {
      "job": 112274336558,
      "time": 236,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11414269556"
    },
    {
      "job": 112276015778,
      "time": 135,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "11414725574"
    },
    {
      "job": 112276015857,
      "time": 264,
      "config": "windows-devel-arm64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11415595158"
    },
    {
      "job": 112276015946,
      "time": 155,
      "config": "windows-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11414532416"
    },
    {
      "job": 112276015729,
      "time": 166,
      "config": "windows-oldrel-x86_64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11414650782"
    },
    {
      "job": 112276015804,
      "time": 262,
      "config": "windows-release-arm64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11414770933"
    },
    {
      "job": 112276015646,
      "time": 187,
      "config": "windows-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11414404764"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807",
  "_status": "success",
  "_upstream": "https://github.com/kaifenglu/drugdemand",
  "_commit": {
    "id": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
    "author": "Kaifeng Lu <kaifenglu@gmail.com>",
    "committer": "Kaifeng Lu <kaifenglu@gmail.com>",
    "message": "- remove the dependence on pscl and icenReg packages\n- add stringr to imported packages\n- add survival::survreg and stats::optim to imported functions\n- use the Brent method for optimization to fit an interval-censored exponential distribution to the time from randomization to the first drug dispensing visit\n- check the number of unique combinations of time and k1 in f_fit_ti\n- use the VarCorr function from the nlme package to obtain the variance of random effects from the lme function call\n- use data from all kit types to inform the common time model\n- add the pred_pp_only parameter to f_drug_demand to make protocol-based predictions only\n- ensure that df and visitview have all the required columns and none of the required columns have missing values\n- combine dosing_pred_df and dosing_pred_pp in the f_drug_demand output\n- handle cases where all patients in a treatment arm discontinued before the cutoff\n- replace round with formatC to retain the zeros after the decimal point\n- rename fit_xx to xx_fit, where xx = k0, t0, t1, ki, ti, di to be consistent with enroll_fit and event_fit naming convention\n- add kit and kit_name to handle cases when a drug has different kit types depending on the site\n- add the prior probability of different kit types within a drug at the design stage\n- streamline the examples through the use of function calls\n- update the initial parameter values in f_fit_ki for zero-inflated Poisson model\n- update the p.fit calculation in f_fit_ti when using the least absolute deviations model\n- convert kit_name to a factor to ensure the correct order when creating a plot\n- add kit_name as the sub plot title in f_dispensing_models.R\n- add the vf_kit parameter to f_dose_draw_1 to get the kit information for each subject in each simulation draw\n- add the f_ongoing_new function to prepare the dosing data sets to impute for ongoing and new subjects\n- add kit_description_df to the output of f_dose_observed\n- add the rdirichlet function to generate cell probab",
    "time": 1709075489
  },
  "_maintainer": {
    "name": "Kaifeng Lu",
    "email": "kaifenglu@gmail.com",
    "login": "kaifenglu",
    "description": "",
    "uuid": 95114218,
    "orcid": "0000-0002-6160-7119"
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "Rcpp",
      "version": ">= 1.0.10",
      "role": "Imports"
    },
    {
      "package": "dplyr",
      "version": ">= 1.1.0",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "version": ">= 1.1.0",
      "role": "Imports"
    },
    {
      "package": "purrr",
      "version": ">= 1.0.2",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "version": ">= 1.4.0",
      "role": "Imports"
    },
    {
      "package": "plotly",
      "version": ">= 4.10.1",
      "role": "Imports"
    },
    {
      "package": "survival",
      "version": ">= 2.41-3",
      "role": "Imports"
    },
    {
      "package": "mvtnorm",
      "version": ">= 1.1-3",
      "role": "Imports"
    },
    {
      "package": "erify",
      "version": ">= 0.4.0",
      "role": "Imports"
    },
    {
      "package": "stats",
      "version": ">= 3.5.0",
      "role": "Imports"
    },
    {
      "package": "MASS",
      "version": ">= 7.3-54",
      "role": "Imports"
    },
    {
      "package": "nlme",
      "version": ">= 3.1-153",
      "role": "Imports"
    },
    {
      "package": "L1pack",
      "version": ">= 0.41-24",
      "role": "Imports"
    },
    {
      "package": "eventPred",
      "version": ">= 0.2.3",
      "role": "Imports"
    },
    {
      "package": "parallel",
      "version": ">= 4.1.2",
      "role": "Imports"
    },
    {
      "package": "foreach",
      "version": ">= 1.5.2",
      "role": "Imports"
    },
    {
      "package": "doParallel",
      "version": ">= 1.0.17",
      "role": "Imports"
    },
    {
      "package": "doRNG",
      "version": ">= 1.8.6",
      "role": "Imports"
    }
  ],
  "_owner": "kaifenglu",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [],
  "_tags": [],
  "_stars": 0,
  "_contributors": [
    {
      "user": "kaifenglu",
      "count": 45,
      "uuid": 95114218
    }
  ],
  "_userbio": {
    "uuid": 95114218,
    "type": "user",
    "name": "kaifenglu",
    "followers": 6
  },
  "_downloads": {
    "count": 338,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/drugDemand"
  },
  "_devurl": "https://github.com/kaifenglu/drugdemand",
  "_searchresults": 5,
  "_topics": [
    "cpp"
  ],
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/drugDemand.html",
    "extra/manual.pdf",
    "extra/NEWS.html",
    "extra/NEWS.txt"
  ],
  "_homeurl": "https://github.com/kaifenglu/drugdemand",
  "_realowner": "kaifenglu",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2023-10-23"
    },
    {
      "version": "0.1.1",
      "date": "2023-10-31"
    },
    {
      "version": "0.1.2",
      "date": "2023-12-21"
    },
    {
      "version": "0.1.3",
      "date": "2024-02-28"
    }
  ],
  "_exports": [
    "f_bar_chart",
    "f_cum_dose",
    "f_dispensing_models",
    "f_dose_draw",
    "f_dose_draw_1",
    "f_dose_draw_t_1",
    "f_dose_observed",
    "f_dose_pp",
    "f_drug_demand",
    "f_fit_di",
    "f_fit_ki",
    "f_fit_t0",
    "f_fit_ti",
    "f_ongoing_new",
    "rdirichlet"
  ],
  "_help": [],
  "_rundeps": [
    "askpass",
    "assertthat",
    "base64enc",
    "bbmle",
    "bdsmatrix",
    "BH",
    "bslib",
    "cachem",
    "cli",
    "codetools",
    "commonmark",
    "cpp11",
    "crosstalk",
    "curl",
    "data.table",
    "deSolve",
    "digest",
    "doParallel",
    "doRNG",
    "dplyr",
    "erify",
    "evaluate",
    "eventPred",
    "farver",
    "fastGHQuad",
    "fastmap",
    "fastmatrix",
    "flexsurv",
    "fontawesome",
    "foreach",
    "fs",
    "generics",
    "ggplot2",
    "glue",
    "gtable",
    "highr",
    "htmltools",
    "htmlwidgets",
    "httpuv",
    "httr",
    "isoband",
    "iterators",
    "jquerylib",
    "jsonlite",
    "knitr",
    "L1pack",
    "labeling",
    "later",
    "lattice",
    "lazyeval",
    "lifecycle",
    "lrstat",
    "lsoda",
    "magrittr",
    "MASS",
    "Matrix",
    "memoise",
    "mgcv",
    "mime",
    "mstate",
    "muhaz",
    "mvtnorm",
    "nlme",
    "numDeriv",
    "openssl",
    "otel",
    "pillar",
    "pkgconfig",
    "plotly",
    "promises",
    "purrr",
    "quadprog",
    "R6",
    "rappdirs",
    "RColorBrewer",
    "Rcpp",
    "RcppArmadillo",
    "RcppParallel",
    "RcppThread",
    "rlang",
    "rmarkdown",
    "rngtools",
    "rstpm2",
    "S7",
    "sass",
    "scales",
    "shiny",
    "sourcetools",
    "statmod",
    "stringi",
    "stringr",
    "survival",
    "sys",
    "tibble",
    "tidyr",
    "tidyselect",
    "tinytex",
    "utf8",
    "vctrs",
    "viridisLite",
    "withr",
    "xfun",
    "xtable",
    "yaml"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "16-20260322-1ubuntu1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_score": 2,
  "_indexed": true,
  "_nocasepkg": "drugdemand",
  "_universes": [
    "kaifenglu"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:14.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/2014a9a6c50b2ca229b4f02cc5ac0742ac1b6ac3a71b0a86e4cd25a3e7b03104",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:54.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/5d1b2cb4caa2cc33e3bb7464f002f28e95d5326197a5251094a397bef22f3b26",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:10.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/2ae115f98617e3c49408c6753f96d28d8af074b7d00d648619cccf555ca6a19b",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:46.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/1b34b9360411ac6363ab42272b5d2c20f157e0b71c8afbb3d86ab4266db4b3b3",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.1.3",
      "date": "2026-10-06T12:47:51.000Z",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/c00afce56aeb0655f01dd5615e6045b05e104470e0d123c1f5bd1943b50fb9b2",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.1.3",
      "date": "2026-10-06T12:49:05.000Z",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/35cde65d4f36943b965bfb6a033577b0a1f63016d9b46ce02b5855c8c9480ee2",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:13.000Z",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/2a91fb0704932b56640716dddb63148132e99a662715e3a00cd6b19f24cba015",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.1.3",
      "date": "2026-10-06T12:49:12.000Z",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/7fddb218f8143da79256dc218afa928aff0996620197cda3bafcb6f7a95f415d",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:27.000Z",
      "arch": "emscripten",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/f952e3fbc786ef632ce4706aad4f743377e2d13641ca0aeffd56fd92f329c40a",
      "status": "success",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.1.3",
      "date": "2026-10-06T12:49:45.000Z",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/411950cbe6f44c199ebe4aeee724f8c60908c23ddc752a6791a3ee35dc7b745b",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.1.3",
      "date": "2026-10-06T12:47:21.000Z",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/4daaec99167ed62fbe9c75eb7489bc56d0ad30ea60ae8103521957dc4d69de0f",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.1.3",
      "date": "2026-10-06T12:47:55.000Z",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/95fbaac5387ceee57e144252e1cd844d55c234b3d9f802031f2025c838af5848",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.1.3",
      "date": "2026-10-06T12:49:41.000Z",
      "arch": "aarch64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/a896887ec0a2ac0cb00c7c3c8b33a74649fa0d142996b9b39513a9882174c465",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.1.3",
      "date": "2026-10-06T12:48:09.000Z",
      "arch": "x86_64",
      "commit": "9ccfcbc0d55bfb9a630c084ecdb3b18c9ee28652",
      "fileid": "https://r2.ropensci.org/22a400611a4817909ebd3752281a5f0b5947dac1aae74037432fb7a9224b7e80",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/kaifenglu/actions/runs/37465145807"
    }
  ]
}