Changing rxode2 compartment numbers
-2023-11-28
+2023-11-30
Source:vignettes/rxode2-cmt.Rmd
rxode2-cmt.Rmd
How rxode2 assigns compartment n
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
summary(pbpk)
-#> rxode2 2.0.14.9000 model named rx_7ecfe139441efa7d6685fa89a52fedb8 model (ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_7ecfe139441efa7d6685fa89a52fedb8__.rxd/rx_7ecfe139441efa7d6685fa89a52fedb8_.so
+#> rxode2 2.0.14.9000 model named rx_8ee4408c660f4c3f31e6d0548ea2c3f1 model (ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_8ee4408c660f4c3f31e6d0548ea2c3f1__.rxd/rx_8ee4408c660f4c3f31e6d0548ea2c3f1_.so
#> NULL
#>
#> Calculated Variables:
@@ -731,7 +731,7 @@ Appending compartments to the model
ode.1c.ka$simulationModel
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_4851cdb3054ffc2f3e5f53f3896aac57 model (ready).
+#> rxode2 2.0.14.9000 model named rx_b8d999c3e65c274ef9e90ceabef41631 model (ready).
#> x$state: depot, center
#> x$stateExtra: eff
#> x$params: V, KA, CL
diff --git a/articles/rxode2-covariates.html b/articles/rxode2-covariates.html
index 5ecaa6180..e49ea6da6 100644
--- a/articles/rxode2-covariates.html
+++ b/articles/rxode2-covariates.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Covariates
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-covariates.Rmd
rxode2-covariates.Rmd
diff --git a/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png b/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png
index d85292221..8ae60b143 100644
Binary files a/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png and b/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png
index d36458f5c..76ed723b0 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png
index e83e147dd..3f0acbfc0 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png
index 1ea7748c9..2e1e759ef 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png
index 158b60465..31e5946fc 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png
index c260fb8b5..7a5ff354a 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png differ
diff --git a/articles/rxode2-data-frame.html b/articles/rxode2-data-frame.html
index 31553e199..879f804d1 100644
--- a/articles/rxode2-data-frame.html
+++ b/articles/rxode2-data-frame.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Data Frames
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-data-frame.Rmd
rxode2-data-frame.Rmd
diff --git a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png
index f946e5dbd..b947d1e02 100644
Binary files a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png
index 796b3dcbc..ca1b4149e 100644
Binary files a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-datasets.html b/articles/rxode2-datasets.html
index 6186fd732..213285710 100644
--- a/articles/rxode2-datasets.html
+++ b/articles/rxode2-datasets.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Event Types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-datasets.Rmd
rxode2-datasets.Rmd
diff --git a/articles/rxode2-event-table.html b/articles/rxode2-event-table.html
index cc34a38bb..6a6393e4b 100644
--- a/articles/rxode2-event-table.html
+++ b/articles/rxode2-event-table.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Easy rxode2 Event Tables
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-event-table.Rmd
rxode2-event-table.Rmd
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png
index 3f37650e8..950911089 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png
index ac02c2a58..cd9bc110d 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png
index 06c65fbab..1f953c6ab 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png
index ba0a9f9c7..c0a458664 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png
index a5ea8e544..a1400e752 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png
index f5c7d5c27..6dd88ebb3 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png
index d647f5766..bf111cc94 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png
index 4844868a8..045225f2c 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png
index 15c4b64a6..e48bd33b9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png
index 15c4b64a6..e48bd33b9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png
index 397029275..3701a8a3e 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png
index 22a53879b..776f2349c 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png
index 45d6ea873..44a29d9e9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png
index e5eb8feee..acf5935f1 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png
index 942e1e747..2bf995a6f 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png
index 9c8a77537..4411ecf72 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-event-types.html b/articles/rxode2-event-types.html
index 91bcc3171..80a148f68 100644
--- a/articles/rxode2-event-types.html
+++ b/articles/rxode2-event-types.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Event Types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-event-types.Rmd
rxode2-event-types.Rmd
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png
index 616c3c4c7..fae451094 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png
index f085a6d3f..9132c5d20 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png
index 714dfd3c0..f9e9054d3 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png
index 0876e81fe..3d2c1d615 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png
index 5ba7c06ee..ae3dacfdc 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png
index 229686692..a93181c4b 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png
index 435fba88d..b9221b1c1 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png
index 290d044b6..bc556eb03 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png differ
diff --git a/articles/rxode2-events-classic.html b/articles/rxode2-events-classic.html
index 9a674057e..a435b5ee6 100644
--- a/articles/rxode2-events-classic.html
+++ b/articles/rxode2-events-classic.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Classic rxode2 Events
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-events-classic.Rmd
rxode2-events-classic.Rmd
diff --git a/articles/rxode2-intro.html b/articles/rxode2-intro.html
index 3108965c3..2197dcfd1 100644
--- a/articles/rxode2-intro.html
+++ b/articles/rxode2-intro.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Introduction to rxode2
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-intro.Rmd
rxode2-intro.Rmd
diff --git a/articles/rxode2-intro_files/figure-html/intro-central-1.png b/articles/rxode2-intro_files/figure-html/intro-central-1.png
index 46963448a..5ef865e59 100644
Binary files a/articles/rxode2-intro_files/figure-html/intro-central-1.png and b/articles/rxode2-intro_files/figure-html/intro-central-1.png differ
diff --git a/articles/rxode2-intro_files/figure-html/intro-effect-1.png b/articles/rxode2-intro_files/figure-html/intro-effect-1.png
index 90229dc81..718f7961e 100644
Binary files a/articles/rxode2-intro_files/figure-html/intro-effect-1.png and b/articles/rxode2-intro_files/figure-html/intro-effect-1.png differ
diff --git a/articles/rxode2-model-types.html b/articles/rxode2-model-types.html
index cd56c4534..3d801b195 100644
--- a/articles/rxode2-model-types.html
+++ b/articles/rxode2-model-types.html
@@ -157,12 +157,12 @@ Advanced Features, Model Types, Techni
-
-
+
+
rxode2 additional model types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-model-types.Rmd
rxode2-model-types.Rmd
@@ -237,18 +237,18 @@ Solved compartment modelsVC or V
),
Peripheral/Tissue (VP
, VT
). While more
translations are available, some example translations are below:
-
-Another popular parameterization is in terms of micro-constants.
+
+Another popular parameterization is in terms of micro-constants.
rxode2 assumes compartment 1
is the central compartment.
The elimination constant would be specified by K
,
Ke
or Kel
. Some example translations are
below:
-
-The last parameterization possible is using alpha
and
+
+The last parameterization possible is using alpha
and
V
and/or A
/B
/C
. Some
example translations are below:
-
-Once the linCmt()
sleuthing is complete, the
+
+Once the linCmt()
sleuthing is complete, the
1
, 2
or 3
compartment model
solution is used as the value of linCmt()
.
The compartments where you can dose in a linear solved system are
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css b/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css
new file mode 100644
index 000000000..6b4538284
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css
@@ -0,0 +1 @@
+.container-fluid.crosstalk-bscols{margin-left:-30px;margin-right:-30px;white-space:normal}body>.container-fluid.crosstalk-bscols{margin-left:auto;margin-right:auto}.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:inline-block;padding-right:12px;vertical-align:top}@media only screen and (max-width: 480px){.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:block;padding-right:inherit}}.crosstalk-input{margin-bottom:15px}.crosstalk-input .control-label{margin-bottom:0;vertical-align:middle}.crosstalk-input input[type="checkbox"]{margin:4px 0 0;margin-top:1px;line-height:normal}.crosstalk-input .checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.crosstalk-input .checkbox>label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.crosstalk-input .checkbox input[type="checkbox"],.crosstalk-input .checkbox-inline input[type="checkbox"]{position:absolute;margin-top:2px;margin-left:-20px}.crosstalk-input .checkbox+.checkbox{margin-top:-5px}.crosstalk-input .checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.crosstalk-input .checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js
new file mode 100644
index 000000000..fd9eb53d2
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js
@@ -0,0 +1,1474 @@
+(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o b) {
+ return 1;
+ }
+}
+
+/**
+ * @private
+ */
+
+var FilterSet = function () {
+ function FilterSet() {
+ _classCallCheck(this, FilterSet);
+
+ this.reset();
+ }
+
+ _createClass(FilterSet, [{
+ key: "reset",
+ value: function reset() {
+ // Key: handle ID, Value: array of selected keys, or null
+ this._handles = {};
+ // Key: key string, Value: count of handles that include it
+ this._keys = {};
+ this._value = null;
+ this._activeHandles = 0;
+ }
+ }, {
+ key: "update",
+ value: function update(handleId, keys) {
+ if (keys !== null) {
+ keys = keys.slice(0); // clone before sorting
+ keys.sort(naturalComparator);
+ }
+
+ var _diffSortedLists = (0, _util.diffSortedLists)(this._handles[handleId], keys),
+ added = _diffSortedLists.added,
+ removed = _diffSortedLists.removed;
+
+ this._handles[handleId] = keys;
+
+ for (var i = 0; i < added.length; i++) {
+ this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;
+ }
+ for (var _i = 0; _i < removed.length; _i++) {
+ this._keys[removed[_i]]--;
+ }
+
+ this._updateValue(keys);
+ }
+
+ /**
+ * @param {string[]} keys Sorted array of strings that indicate
+ * a superset of possible keys.
+ * @private
+ */
+
+ }, {
+ key: "_updateValue",
+ value: function _updateValue() {
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._allKeys;
+
+ var handleCount = Object.keys(this._handles).length;
+ if (handleCount === 0) {
+ this._value = null;
+ } else {
+ this._value = [];
+ for (var i = 0; i < keys.length; i++) {
+ var count = this._keys[keys[i]];
+ if (count === handleCount) {
+ this._value.push(keys[i]);
+ }
+ }
+ }
+ }
+ }, {
+ key: "clear",
+ value: function clear(handleId) {
+ if (typeof this._handles[handleId] === "undefined") {
+ return;
+ }
+
+ var keys = this._handles[handleId];
+ if (!keys) {
+ keys = [];
+ }
+
+ for (var i = 0; i < keys.length; i++) {
+ this._keys[keys[i]]--;
+ }
+ delete this._handles[handleId];
+
+ this._updateValue();
+ }
+ }, {
+ key: "value",
+ get: function get() {
+ return this._value;
+ }
+ }, {
+ key: "_allKeys",
+ get: function get() {
+ var allKeys = Object.keys(this._keys);
+ allKeys.sort(naturalComparator);
+ return allKeys;
+ }
+ }]);
+
+ return FilterSet;
+}();
+
+exports.default = FilterSet;
+
+},{"./util":11}],4:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.default = group;
+
+var _var2 = require("./var");
+
+var _var3 = _interopRequireDefault(_var2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+// Use a global so that multiple copies of crosstalk.js can be loaded and still
+// have groups behave as singletons across all copies.
+global.__crosstalk_groups = global.__crosstalk_groups || {};
+var groups = global.__crosstalk_groups;
+
+function group(groupName) {
+ if (groupName && typeof groupName === "string") {
+ if (!groups.hasOwnProperty(groupName)) {
+ groups[groupName] = new Group(groupName);
+ }
+ return groups[groupName];
+ } else if ((typeof groupName === "undefined" ? "undefined" : _typeof(groupName)) === "object" && groupName._vars && groupName.var) {
+ // Appears to already be a group object
+ return groupName;
+ } else if (Array.isArray(groupName) && groupName.length == 1 && typeof groupName[0] === "string") {
+ return group(groupName[0]);
+ } else {
+ throw new Error("Invalid groupName argument");
+ }
+}
+
+var Group = function () {
+ function Group(name) {
+ _classCallCheck(this, Group);
+
+ this.name = name;
+ this._vars = {};
+ }
+
+ _createClass(Group, [{
+ key: "var",
+ value: function _var(name) {
+ if (!name || typeof name !== "string") {
+ throw new Error("Invalid var name");
+ }
+
+ if (!this._vars.hasOwnProperty(name)) this._vars[name] = new _var3.default(this, name);
+ return this._vars[name];
+ }
+ }, {
+ key: "has",
+ value: function has(name) {
+ if (!name || typeof name !== "string") {
+ throw new Error("Invalid var name");
+ }
+
+ return this._vars.hasOwnProperty(name);
+ }
+ }]);
+
+ return Group;
+}();
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./var":12}],5:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _group = require("./group");
+
+var _group2 = _interopRequireDefault(_group);
+
+var _selection = require("./selection");
+
+var _filter = require("./filter");
+
+var _input = require("./input");
+
+require("./input_selectize");
+
+require("./input_checkboxgroup");
+
+require("./input_slider");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var defaultGroup = (0, _group2.default)("default");
+
+function var_(name) {
+ return defaultGroup.var(name);
+}
+
+function has(name) {
+ return defaultGroup.has(name);
+}
+
+if (global.Shiny) {
+ global.Shiny.addCustomMessageHandler("update-client-value", function (message) {
+ if (typeof message.group === "string") {
+ (0, _group2.default)(message.group).var(message.name).set(message.value);
+ } else {
+ var_(message.name).set(message.value);
+ }
+ });
+}
+
+var crosstalk = {
+ group: _group2.default,
+ var: var_,
+ has: has,
+ SelectionHandle: _selection.SelectionHandle,
+ FilterHandle: _filter.FilterHandle,
+ bind: _input.bind
+};
+
+/**
+ * @namespace crosstalk
+ */
+exports.default = crosstalk;
+
+global.crosstalk = crosstalk;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./group":4,"./input":6,"./input_checkboxgroup":7,"./input_selectize":8,"./input_slider":9,"./selection":10}],6:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.register = register;
+exports.bind = bind;
+var $ = global.jQuery;
+
+var bindings = {};
+
+function register(reg) {
+ bindings[reg.className] = reg;
+ if (global.document && global.document.readyState !== "complete") {
+ $(function () {
+ bind();
+ });
+ } else if (global.document) {
+ setTimeout(bind, 100);
+ }
+}
+
+function bind() {
+ Object.keys(bindings).forEach(function (className) {
+ var binding = bindings[className];
+ $("." + binding.className).not(".crosstalk-input-bound").each(function (i, el) {
+ bindInstance(binding, el);
+ });
+ });
+}
+
+// Escape jQuery identifier
+function $escape(val) {
+ return val.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
+}
+
+function bindEl(el) {
+ var $el = $(el);
+ Object.keys(bindings).forEach(function (className) {
+ if ($el.hasClass(className) && !$el.hasClass("crosstalk-input-bound")) {
+ var binding = bindings[className];
+ bindInstance(binding, el);
+ }
+ });
+}
+
+function bindInstance(binding, el) {
+ var jsonEl = $(el).find("script[type='application/json'][data-for='" + $escape(el.id) + "']");
+ var data = JSON.parse(jsonEl[0].innerText);
+
+ var instance = binding.factory(el, data);
+ $(el).data("crosstalk-instance", instance);
+ $(el).addClass("crosstalk-input-bound");
+}
+
+if (global.Shiny) {
+ var inputBinding = new global.Shiny.InputBinding();
+ var _$ = global.jQuery;
+ _$.extend(inputBinding, {
+ find: function find(scope) {
+ return _$(scope).find(".crosstalk-input");
+ },
+ initialize: function initialize(el) {
+ if (!_$(el).hasClass("crosstalk-input-bound")) {
+ bindEl(el);
+ }
+ },
+ getId: function getId(el) {
+ return el.id;
+ },
+ getValue: function getValue(el) {},
+ setValue: function setValue(el, value) {},
+ receiveMessage: function receiveMessage(el, data) {},
+ subscribe: function subscribe(el, callback) {
+ _$(el).data("crosstalk-instance").resume();
+ },
+ unsubscribe: function unsubscribe(el) {
+ _$(el).data("crosstalk-instance").suspend();
+ }
+ });
+ global.Shiny.inputBindings.register(inputBinding, "crosstalk.inputBinding");
+}
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],7:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+
+input.register({
+ className: "crosstalk-input-checkboxgroup",
+
+ factory: function factory(el, data) {
+ /*
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var lastKnownKeys = void 0;
+ var $el = $(el);
+ $el.on("change", "input[type='checkbox']", function () {
+ var checked = $el.find("input[type='checkbox']:checked");
+ if (checked.length === 0) {
+ lastKnownKeys = null;
+ ctHandle.clear();
+ } else {
+ var keys = {};
+ checked.each(function () {
+ data.map[this.value].forEach(function (key) {
+ keys[key] = true;
+ });
+ });
+ var keyArray = Object.keys(keys);
+ keyArray.sort();
+ lastKnownKeys = keyArray;
+ ctHandle.set(keyArray);
+ }
+ });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6}],8:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _util = require("./util");
+
+var util = _interopRequireWildcard(_util);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+
+input.register({
+ className: "crosstalk-input-select",
+
+ factory: function factory(el, data) {
+ /*
+ * items: {value: [...], label: [...]}
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+
+ var first = [{ value: "", label: "(All)" }];
+ var items = util.dataframeToD3(data.items);
+ var opts = {
+ options: first.concat(items),
+ valueField: "value",
+ labelField: "label",
+ searchField: "label"
+ };
+
+ var select = $(el).find("select")[0];
+
+ var selectize = $(select).selectize(opts)[0].selectize;
+
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var lastKnownKeys = void 0;
+ selectize.on("change", function () {
+ if (selectize.items.length === 0) {
+ lastKnownKeys = null;
+ ctHandle.clear();
+ } else {
+ var keys = {};
+ selectize.items.forEach(function (group) {
+ data.map[group].forEach(function (key) {
+ keys[key] = true;
+ });
+ });
+ var keyArray = Object.keys(keys);
+ keyArray.sort();
+ lastKnownKeys = keyArray;
+ ctHandle.set(keyArray);
+ }
+ });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6,"./util":11}],9:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+var strftime = global.strftime;
+
+input.register({
+ className: "crosstalk-input-slider",
+
+ factory: function factory(el, data) {
+ /*
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var opts = {};
+ var $el = $(el).find("input");
+ var dataType = $el.data("data-type");
+ var timeFormat = $el.data("time-format");
+ var round = $el.data("round");
+ var timeFormatter = void 0;
+
+ // Set up formatting functions
+ if (dataType === "date") {
+ timeFormatter = strftime.utc();
+ opts.prettify = function (num) {
+ return timeFormatter(timeFormat, new Date(num));
+ };
+ } else if (dataType === "datetime") {
+ var timezone = $el.data("timezone");
+ if (timezone) timeFormatter = strftime.timezone(timezone);else timeFormatter = strftime;
+
+ opts.prettify = function (num) {
+ return timeFormatter(timeFormat, new Date(num));
+ };
+ } else if (dataType === "number") {
+ if (typeof round !== "undefined") opts.prettify = function (num) {
+ var factor = Math.pow(10, round);
+ return Math.round(num * factor) / factor;
+ };
+ }
+
+ $el.ionRangeSlider(opts);
+
+ function getValue() {
+ var result = $el.data("ionRangeSlider").result;
+
+ // Function for converting numeric value from slider to appropriate type.
+ var convert = void 0;
+ var dataType = $el.data("data-type");
+ if (dataType === "date") {
+ convert = function convert(val) {
+ return formatDateUTC(new Date(+val));
+ };
+ } else if (dataType === "datetime") {
+ convert = function convert(val) {
+ // Convert ms to s
+ return +val / 1000;
+ };
+ } else {
+ convert = function convert(val) {
+ return +val;
+ };
+ }
+
+ if ($el.data("ionRangeSlider").options.type === "double") {
+ return [convert(result.from), convert(result.to)];
+ } else {
+ return convert(result.from);
+ }
+ }
+
+ var lastKnownKeys = null;
+
+ $el.on("change.crosstalkSliderInput", function (event) {
+ if (!$el.data("updating") && !$el.data("animating")) {
+ var _getValue = getValue(),
+ _getValue2 = _slicedToArray(_getValue, 2),
+ from = _getValue2[0],
+ to = _getValue2[1];
+
+ var keys = [];
+ for (var i = 0; i < data.values.length; i++) {
+ var val = data.values[i];
+ if (val >= from && val <= to) {
+ keys.push(data.keys[i]);
+ }
+ }
+ keys.sort();
+ ctHandle.set(keys);
+ lastKnownKeys = keys;
+ }
+ });
+
+ // let $el = $(el);
+ // $el.on("change", "input[type="checkbox"]", function() {
+ // let checked = $el.find("input[type="checkbox"]:checked");
+ // if (checked.length === 0) {
+ // ctHandle.clear();
+ // } else {
+ // let keys = {};
+ // checked.each(function() {
+ // data.map[this.value].forEach(function(key) {
+ // keys[key] = true;
+ // });
+ // });
+ // let keyArray = Object.keys(keys);
+ // keyArray.sort();
+ // ctHandle.set(keyArray);
+ // }
+ // });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+// Convert a number to a string with leading zeros
+function padZeros(n, digits) {
+ var str = n.toString();
+ while (str.length < digits) {
+ str = "0" + str;
+ }return str;
+}
+
+// Given a Date object, return a string in yyyy-mm-dd format, using the
+// UTC date. This may be a day off from the date in the local time zone.
+function formatDateUTC(date) {
+ if (date instanceof Date) {
+ return date.getUTCFullYear() + "-" + padZeros(date.getUTCMonth() + 1, 2) + "-" + padZeros(date.getUTCDate(), 2);
+ } else {
+ return null;
+ }
+}
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6}],10:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.SelectionHandle = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _events = require("./events");
+
+var _events2 = _interopRequireDefault(_events);
+
+var _group = require("./group");
+
+var _group2 = _interopRequireDefault(_group);
+
+var _util = require("./util");
+
+var util = _interopRequireWildcard(_util);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ * Use this class to read and write (and listen for changes to) the selection
+ * for a Crosstalk group. This is intended to be used for linked brushing.
+ *
+ * If two (or more) `SelectionHandle` instances in the same webpage share the
+ * same group name, they will share the same state. Setting the selection using
+ * one `SelectionHandle` instance will result in the `value` property instantly
+ * changing across the others, and `"change"` event listeners on all instances
+ * (including the one that initiated the sending) will fire.
+ *
+ * @param {string} [group] - The name of the Crosstalk group, or if none,
+ * null or undefined (or any other falsy value). This can be changed later
+ * via the [SelectionHandle#setGroup](#setGroup) method.
+ * @param {Object} [extraInfo] - An object whose properties will be copied to
+ * the event object whenever an event is emitted.
+ */
+var SelectionHandle = exports.SelectionHandle = function () {
+ function SelectionHandle() {
+ var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+ var extraInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+
+ _classCallCheck(this, SelectionHandle);
+
+ this._eventRelay = new _events2.default();
+ this._emitter = new util.SubscriptionTracker(this._eventRelay);
+
+ // Name of the group we're currently tracking, if any. Can change over time.
+ this._group = null;
+ // The Var we're currently tracking, if any. Can change over time.
+ this._var = null;
+ // The event handler subscription we currently have on var.on("change").
+ this._varOnChangeSub = null;
+
+ this._extraInfo = util.extend({ sender: this }, extraInfo);
+
+ this.setGroup(group);
+ }
+
+ /**
+ * Changes the Crosstalk group membership of this SelectionHandle. The group
+ * being switched away from (if any) will not have its selection value
+ * modified as a result of calling `setGroup`, even if this handle was the
+ * most recent handle to set the selection of the group.
+ *
+ * The group being switched to (if any) will also not have its selection value
+ * modified as a result of calling `setGroup`. If you want to set the
+ * selection value of the new group, call `set` explicitly.
+ *
+ * @param {string} group - The name of the Crosstalk group, or null (or
+ * undefined) to clear the group.
+ */
+
+
+ _createClass(SelectionHandle, [{
+ key: "setGroup",
+ value: function setGroup(group) {
+ var _this = this;
+
+ // If group is unchanged, do nothing
+ if (this._group === group) return;
+ // Treat null, undefined, and other falsy values the same
+ if (!this._group && !group) return;
+
+ if (this._var) {
+ this._var.off("change", this._varOnChangeSub);
+ this._var = null;
+ this._varOnChangeSub = null;
+ }
+
+ this._group = group;
+
+ if (group) {
+ this._var = (0, _group2.default)(group).var("selection");
+ var sub = this._var.on("change", function (e) {
+ _this._eventRelay.trigger("change", e, _this);
+ });
+ this._varOnChangeSub = sub;
+ }
+ }
+
+ /**
+ * Retrieves the current selection for the group represented by this
+ * `SelectionHandle`.
+ *
+ * - If no selection is active, then this value will be falsy.
+ * - If a selection is active, but no data points are selected, then this
+ * value will be an empty array.
+ * - If a selection is active, and data points are selected, then the keys
+ * of the selected data points will be present in the array.
+ */
+
+ }, {
+ key: "_mergeExtraInfo",
+
+
+ /**
+ * Combines the given `extraInfo` (if any) with the handle's default
+ * `_extraInfo` (if any).
+ * @private
+ */
+ value: function _mergeExtraInfo(extraInfo) {
+ // Important incidental effect: shallow clone is returned
+ return util.extend({}, this._extraInfo ? this._extraInfo : null, extraInfo ? extraInfo : null);
+ }
+
+ /**
+ * Overwrites the current selection for the group, and raises the `"change"`
+ * event among all of the group's '`SelectionHandle` instances (including
+ * this one).
+ *
+ * @fires SelectionHandle#change
+ * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see
+ * {@link SelectionHandle#value}).
+ * @param {Object} [extraInfo] - Extra properties to be included on the event
+ * object that's passed to listeners (in addition to any options that were
+ * passed into the `SelectionHandle` constructor).
+ */
+
+ }, {
+ key: "set",
+ value: function set(selectedKeys, extraInfo) {
+ if (this._var) this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));
+ }
+
+ /**
+ * Overwrites the current selection for the group, and raises the `"change"`
+ * event among all of the group's '`SelectionHandle` instances (including
+ * this one).
+ *
+ * @fires SelectionHandle#change
+ * @param {Object} [extraInfo] - Extra properties to be included on the event
+ * object that's passed to listeners (in addition to any that were passed
+ * into the `SelectionHandle` constructor).
+ */
+
+ }, {
+ key: "clear",
+ value: function clear(extraInfo) {
+ if (this._var) this.set(void 0, this._mergeExtraInfo(extraInfo));
+ }
+
+ /**
+ * Subscribes to events on this `SelectionHandle`.
+ *
+ * @param {string} eventType - Indicates the type of events to listen to.
+ * Currently, only `"change"` is supported.
+ * @param {SelectionHandle~listener} listener - The callback function that
+ * will be invoked when the event occurs.
+ * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel
+ * this subscription.
+ */
+
+ }, {
+ key: "on",
+ value: function on(eventType, listener) {
+ return this._emitter.on(eventType, listener);
+ }
+
+ /**
+ * Cancels event subscriptions created by {@link SelectionHandle#on}.
+ *
+ * @param {string} eventType - The type of event to unsubscribe.
+ * @param {string|SelectionHandle~listener} listener - Either the callback
+ * function previously passed into {@link SelectionHandle#on}, or the
+ * string that was returned from {@link SelectionHandle#on}.
+ */
+
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ return this._emitter.off(eventType, listener);
+ }
+
+ /**
+ * Shuts down the `SelectionHandle` object.
+ *
+ * Removes all event listeners that were added through this handle.
+ */
+
+ }, {
+ key: "close",
+ value: function close() {
+ this._emitter.removeAllListeners();
+ this.setGroup(null);
+ }
+ }, {
+ key: "value",
+ get: function get() {
+ return this._var ? this._var.get() : null;
+ }
+ }]);
+
+ return SelectionHandle;
+}();
+
+/**
+ * @callback SelectionHandle~listener
+ * @param {Object} event - An object containing details of the event. For
+ * `"change"` events, this includes the properties `value` (the new
+ * value of the selection, or `undefined` if no selection is active),
+ * `oldValue` (the previous value of the selection), and `sender` (the
+ * `SelectionHandle` instance that made the change).
+ */
+
+/**
+ * @event SelectionHandle#change
+ * @type {object}
+ * @property {object} value - The new value of the selection, or `undefined`
+ * if no selection is active.
+ * @property {object} oldValue - The previous value of the selection.
+ * @property {SelectionHandle} sender - The `SelectionHandle` instance that
+ * changed the value.
+ */
+
+},{"./events":1,"./group":4,"./util":11}],11:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.extend = extend;
+exports.checkSorted = checkSorted;
+exports.diffSortedLists = diffSortedLists;
+exports.dataframeToD3 = dataframeToD3;
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function extend(target) {
+ for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ sources[_key - 1] = arguments[_key];
+ }
+
+ for (var i = 0; i < sources.length; i++) {
+ var src = sources[i];
+ if (typeof src === "undefined" || src === null) continue;
+
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) {
+ target[key] = src[key];
+ }
+ }
+ }
+ return target;
+}
+
+function checkSorted(list) {
+ for (var i = 1; i < list.length; i++) {
+ if (list[i] <= list[i - 1]) {
+ throw new Error("List is not sorted or contains duplicate");
+ }
+ }
+}
+
+function diffSortedLists(a, b) {
+ var i_a = 0;
+ var i_b = 0;
+
+ if (!a) a = [];
+ if (!b) b = [];
+
+ var a_only = [];
+ var b_only = [];
+
+ checkSorted(a);
+ checkSorted(b);
+
+ while (i_a < a.length && i_b < b.length) {
+ if (a[i_a] === b[i_b]) {
+ i_a++;
+ i_b++;
+ } else if (a[i_a] < b[i_b]) {
+ a_only.push(a[i_a++]);
+ } else {
+ b_only.push(b[i_b++]);
+ }
+ }
+
+ if (i_a < a.length) a_only = a_only.concat(a.slice(i_a));
+ if (i_b < b.length) b_only = b_only.concat(b.slice(i_b));
+ return {
+ removed: a_only,
+ added: b_only
+ };
+}
+
+// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }
+// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]
+function dataframeToD3(df) {
+ var names = [];
+ var length = void 0;
+ for (var name in df) {
+ if (df.hasOwnProperty(name)) names.push(name);
+ if (_typeof(df[name]) !== "object" || typeof df[name].length === "undefined") {
+ throw new Error("All fields must be arrays");
+ } else if (typeof length !== "undefined" && length !== df[name].length) {
+ throw new Error("All fields must be arrays of the same length");
+ }
+ length = df[name].length;
+ }
+ var results = [];
+ var item = void 0;
+ for (var row = 0; row < length; row++) {
+ item = {};
+ for (var col = 0; col < names.length; col++) {
+ item[names[col]] = df[names[col]][row];
+ }
+ results.push(item);
+ }
+ return results;
+}
+
+/**
+ * Keeps track of all event listener additions/removals and lets all active
+ * listeners be removed with a single operation.
+ *
+ * @private
+ */
+
+var SubscriptionTracker = exports.SubscriptionTracker = function () {
+ function SubscriptionTracker(emitter) {
+ _classCallCheck(this, SubscriptionTracker);
+
+ this._emitter = emitter;
+ this._subs = {};
+ }
+
+ _createClass(SubscriptionTracker, [{
+ key: "on",
+ value: function on(eventType, listener) {
+ var sub = this._emitter.on(eventType, listener);
+ this._subs[sub] = eventType;
+ return sub;
+ }
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ var sub = this._emitter.off(eventType, listener);
+ if (sub) {
+ delete this._subs[sub];
+ }
+ return sub;
+ }
+ }, {
+ key: "removeAllListeners",
+ value: function removeAllListeners() {
+ var _this = this;
+
+ var current_subs = this._subs;
+ this._subs = {};
+ Object.keys(current_subs).forEach(function (sub) {
+ _this._emitter.off(current_subs[sub], sub);
+ });
+ }
+ }]);
+
+ return SubscriptionTracker;
+}();
+
+},{}],12:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _events = require("./events");
+
+var _events2 = _interopRequireDefault(_events);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Var = function () {
+ function Var(group, name, /*optional*/value) {
+ _classCallCheck(this, Var);
+
+ this._group = group;
+ this._name = name;
+ this._value = value;
+ this._events = new _events2.default();
+ }
+
+ _createClass(Var, [{
+ key: "get",
+ value: function get() {
+ return this._value;
+ }
+ }, {
+ key: "set",
+ value: function set(value, /*optional*/event) {
+ if (this._value === value) {
+ // Do nothing; the value hasn't changed
+ return;
+ }
+ var oldValue = this._value;
+ this._value = value;
+ // Alert JavaScript listeners that the value has changed
+ var evt = {};
+ if (event && (typeof event === "undefined" ? "undefined" : _typeof(event)) === "object") {
+ for (var k in event) {
+ if (event.hasOwnProperty(k)) evt[k] = event[k];
+ }
+ }
+ evt.oldValue = oldValue;
+ evt.value = value;
+ this._events.trigger("change", evt, this);
+
+ // TODO: Make this extensible, to let arbitrary back-ends know that
+ // something has changed
+ if (global.Shiny && global.Shiny.onInputChange) {
+ global.Shiny.onInputChange(".clientValue-" + (this._group.name !== null ? this._group.name + "-" : "") + this._name, typeof value === "undefined" ? null : value);
+ }
+ }
+ }, {
+ key: "on",
+ value: function on(eventType, listener) {
+ return this._events.on(eventType, listener);
+ }
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ return this._events.off(eventType, listener);
+ }
+ }]);
+
+ return Var;
+}();
+
+exports.default = Var;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./events":1}]},{},[5])
+//# sourceMappingURL=crosstalk.js.map
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map
new file mode 100644
index 000000000..cff94f089
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map
@@ -0,0 +1,37 @@
+{
+ "version": 3,
+ "sources": [
+ "node_modules/browser-pack/_prelude.js",
+ "javascript/src/events.js",
+ "javascript/src/filter.js",
+ "javascript/src/filterset.js",
+ "javascript/src/group.js",
+ "javascript/src/index.js",
+ "javascript/src/input.js",
+ "javascript/src/input_checkboxgroup.js",
+ "javascript/src/input_selectize.js",
+ "javascript/src/input_slider.js",
+ "javascript/src/selection.js",
+ "javascript/src/util.js",
+ "javascript/src/var.js"
+ ],
+ "names": [],
+ "mappings": "AAAA;;;;;;;;;;;ICAqB,M;AACnB,oBAAc;AAAA;;AACZ,SAAK,MAAL,GAAc,EAAd;AACA,SAAK,IAAL,GAAY,CAAZ;AACD;;;;uBAEE,S,EAAW,Q,EAAU;AACtB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,CAAC,IAAL,EAAW;AACT,eAAO,KAAK,MAAL,CAAY,SAAZ,IAAyB,EAAhC;AACD;AACD,UAAI,MAAM,QAAS,KAAK,IAAL,EAAnB;AACA,WAAK,GAAL,IAAY,QAAZ;AACA,aAAO,GAAP;AACD;;AAED;;;;wBACI,S,EAAW,Q,EAAU;AACvB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,OAAO,QAAP,KAAqB,UAAzB,EAAqC;AACnC,aAAK,IAAI,GAAT,IAAgB,IAAhB,EAAsB;AACpB,cAAI,KAAK,cAAL,CAAoB,GAApB,CAAJ,EAA8B;AAC5B,gBAAI,KAAK,GAAL,MAAc,QAAlB,EAA4B;AAC1B,qBAAO,KAAK,GAAL,CAAP;AACA,qBAAO,GAAP;AACD;AACF;AACF;AACD,eAAO,KAAP;AACD,OAVD,MAUO,IAAI,OAAO,QAAP,KAAqB,QAAzB,EAAmC;AACxC,YAAI,QAAQ,KAAK,QAAL,CAAZ,EAA4B;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;uBAEE,S,EAAW,Q,EAAU;AACtB,aAAO,KAAK,OAAL,CAAa,EAAb,CAAgB,SAAhB,EAA2B,QAA3B,CAAP;AACD;;;wBAEG,S,EAAW,Q,EAAU;AACvB,aAAO,KAAK,OAAL,CAAa,GAAb,CAAiB,SAAjB,EAA4B,QAA5B,CAAP;AACD;;;;;;kBAjDkB,G",
+ "file": "generated.js",
+ "sourceRoot": "",
+ "sourcesContent": [
+ "(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n",
+ "import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n",
+ "import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n",
+ "import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n",
+ "let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n",
+ "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
+ "import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
+ "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n",
+ "import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n",
+ "export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n",
+ "import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js
new file mode 100644
index 000000000..b7ec0ac9f
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js
@@ -0,0 +1,2 @@
+!function o(u,a,l){function s(n,e){if(!a[n]){if(!u[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[n]={exports:{}};u[n][0].call(i.exports,function(e){var t=u[n][1][e];return s(t||e)},i,i.exports,o,u,a,l)}return a[n].exports}for(var f="function"==typeof require&&require,e=0;e?@[\\\]^`{|}~])/g,"\\$1")+"']"),r=JSON.parse(n[0].innerText),i=e.factory(t,r);o(t).data("crosstalk-instance",i),o(t).addClass("crosstalk-input-bound")}if(t.Shiny){var e=new t.Shiny.InputBinding,u=t.jQuery;u.extend(e,{find:function(e){return u(e).find(".crosstalk-input")},initialize:function(e){var t,n;u(e).hasClass("crosstalk-input-bound")||(n=o(t=e),Object.keys(r).forEach(function(e){n.hasClass(e)&&!n.hasClass("crosstalk-input-bound")&&i(r[e],t)}))},getId:function(e){return e.id},getValue:function(e){},setValue:function(e,t){},receiveMessage:function(e,t){},subscribe:function(e,t){u(e).data("crosstalk-instance").resume()},unsubscribe:function(e){u(e).data("crosstalk-instance").suspend()}}),t.Shiny.inputBindings.register(e,"crosstalk.inputBinding")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(r,e,t){(function(e){"use strict";var t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(r("./input")),n=r("./filter");var a=e.jQuery;t.register({className:"crosstalk-input-checkboxgroup",factory:function(e,r){var i=new n.FilterHandle(r.group),o=void 0,u=a(e);return u.on("change","input[type='checkbox']",function(){var e=u.find("input[type='checkbox']:checked");if(0===e.length)o=null,i.clear();else{var t={};e.each(function(){r.map[this.value].forEach(function(e){t[e]=!0})});var n=Object.keys(t);n.sort(),o=n,i.set(n)}}),{suspend:function(){i.clear()},resume:function(){o&&i.set(o)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6}],8:[function(r,e,t){(function(e){"use strict";var t=n(r("./input")),l=n(r("./util")),s=r("./filter");function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var f=e.jQuery;t.register({className:"crosstalk-input-select",factory:function(e,n){var t=l.dataframeToD3(n.items),r={options:[{value:"",label:"(All)"}].concat(t),valueField:"value",labelField:"label",searchField:"label"},i=f(e).find("select")[0],o=f(i).selectize(r)[0].selectize,u=new s.FilterHandle(n.group),a=void 0;return o.on("change",function(){if(0===o.items.length)a=null,u.clear();else{var t={};o.items.forEach(function(e){n.map[e].forEach(function(e){t[e]=!0})});var e=Object.keys(t);e.sort(),a=e,u.set(e)}}),{suspend:function(){u.clear()},resume:function(){a&&u.set(a)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6,"./util":11}],9:[function(n,e,t){(function(e){"use strict";var d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./input")),a=n("./filter");var v=e.jQuery,p=e.strftime;function y(e,t){for(var n=e.toString();n.length {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n","import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n","import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n","import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n","let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n","import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n","export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n","import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"]}
\ No newline at end of file
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss b/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss
new file mode 100644
index 000000000..35665616f
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss
@@ -0,0 +1,75 @@
+/* Adjust margins outwards, so column contents line up with the edges of the
+ parent of container-fluid. */
+.container-fluid.crosstalk-bscols {
+ margin-left: -30px;
+ margin-right: -30px;
+ white-space: normal;
+}
+
+/* But don't adjust the margins outwards if we're directly under the body,
+ i.e. we were the top-level of something at the console. */
+body > .container-fluid.crosstalk-bscols {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
+ display: inline-block;
+ padding-right: 12px;
+ vertical-align: top;
+}
+
+@media only screen and (max-width:480px) {
+ .crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
+ display: block;
+ padding-right: inherit;
+ }
+}
+
+/* Relevant BS3 styles to make filter_checkbox() look reasonable without Bootstrap */
+.crosstalk-input {
+ margin-bottom: 15px; /* a la .form-group */
+ .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ input[type="checkbox"] {
+ margin: 4px 0 0;
+ margin-top: 1px;
+ line-height: normal;
+ }
+ .checkbox {
+ position: relative;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+ .checkbox > label{
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ cursor: pointer;
+ }
+ .checkbox input[type="checkbox"],
+ .checkbox-inline input[type="checkbox"] {
+ position: absolute;
+ margin-top: 2px;
+ margin-left: -20px;
+ }
+ .checkbox + .checkbox {
+ margin-top: -5px;
+ }
+ .checkbox-inline {
+ position: relative;
+ display: inline-block;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ vertical-align: middle;
+ cursor: pointer;
+ }
+ .checkbox-inline + .checkbox-inline {
+ margin-top: 0;
+ margin-left: 10px;
+ }
+}
diff --git a/articles/rxode2-nesting.html b/articles/rxode2-nesting.html
index 6c677d836..2533aa763 100644
--- a/articles/rxode2-nesting.html
+++ b/articles/rxode2-nesting.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Nesting levels in rxode2
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-nesting.Rmd
rxode2-nesting.Rmd
@@ -312,24 +312,24 @@ Uncertainty in Model parametersdimnames(tMat) <- list(names(theta), names(theta))
tMat
-#> TKA TCl V2 Q V3 Kin
-#> TKA 0.10062025 -0.12295469 -0.04531495 -0.02397077 -0.02434600 -0.04904029
-#> TCl -0.12295469 0.25162132 -0.01212188 0.02716814 0.06137190 0.05300572
-#> V2 -0.04531495 -0.01212188 0.23379983 -0.02496544 -0.04012738 0.07997442
-#> Q -0.02397077 0.02716814 -0.02496544 0.02821405 0.02076256 -0.04388260
-#> V3 -0.02434600 0.06137190 -0.04012738 0.02076256 0.16198186 -0.11895883
-#> Kin -0.04904029 0.05300572 0.07997442 -0.04388260 -0.11895883 0.26339638
-#> Kout -0.03343029 -0.02601856 0.08114984 0.02523323 -0.01569376 -0.03609746
-#> EC50 -0.12588070 0.14843107 -0.03577880 0.05992831 0.07451059 -0.02226063
-#> Kout EC50
-#> TKA -0.03343029 -0.12588070
-#> TCl -0.02601856 0.14843107
-#> V2 0.08114984 -0.03577880
-#> Q 0.02523323 0.05992831
-#> V3 -0.01569376 0.07451059
-#> Kin -0.03609746 -0.02226063
-#> Kout 0.09716982 0.03006571
-#> EC50 0.03006571 0.31726414
+#> TKA TCl V2 Q V3
+#> TKA 0.11619015 0.073703715 0.04369253 -0.016660366 -0.011193396
+#> TCl 0.07370372 0.113971693 0.06841157 -0.015578152 -0.055073884
+#> V2 0.04369253 0.068411574 0.22142001 -0.074616276 -0.019774853
+#> Q -0.01666037 -0.015578152 -0.07461628 0.075884128 0.020726895
+#> V3 -0.01119340 -0.055073884 -0.01977485 0.020726895 0.075776432
+#> Kin 0.01846965 -0.033098860 0.04143756 -0.008003217 0.020555705
+#> Kout -0.02395367 -0.010482608 -0.02421182 -0.010248683 -0.007926701
+#> EC50 -0.01338289 -0.006578812 -0.05736582 0.089005982 0.030902333
+#> Kin Kout EC50
+#> TKA 0.018469652 -0.023953675 -0.013382894
+#> TCl -0.033098860 -0.010482608 -0.006578812
+#> V2 0.041437564 -0.024211825 -0.057365823
+#> Q -0.008003217 -0.010248683 0.089005982
+#> V3 0.020555705 -0.007926701 0.030902333
+#> Kin 0.083079307 -0.012669148 -0.015209539
+#> Kout -0.012669148 0.109646723 -0.028508758
+#> EC50 -0.015209539 -0.028508758 0.117687226
Nesting Variability
@@ -397,8 +397,6 @@ Solving the problem=400)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
#> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout
-#> @(lsoda.c:750
-#> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout
#> @(lsoda.c:750
#> Warning: some ID(s) could not solve the ODEs correctly; These values are
#> replaced with 'NA'
@@ -409,16 +407,16 @@ Solving the problem#> # A tibble: 8,000 x 24
#> sim.id id `inv.Cl(inv==1)` `inv.Cl(inv==2)` `inv.Ka(inv==1)`
#> <int> <fct> <dbl> <dbl> <dbl>
-#> 1 1 1 -0.0390 -0.0402 -0.0942
-#> 2 1 2 -0.0390 -0.0402 -0.0942
-#> 3 1 3 -0.0390 -0.0402 -0.0942
-#> 4 1 4 -0.0390 -0.0402 -0.0942
-#> 5 1 5 -0.0390 -0.0402 -0.0942
-#> 6 1 6 -0.0390 -0.0402 -0.0942
-#> 7 1 7 -0.0390 -0.0402 -0.0942
-#> 8 1 8 -0.0390 -0.0402 -0.0942
-#> 9 1 9 -0.0390 -0.0402 -0.0942
-#> 10 1 10 -0.0390 -0.0402 -0.0942
+#> 1 1 1 0.108 0.363 -0.110
+#> 2 1 2 0.108 0.363 -0.110
+#> 3 1 3 0.108 0.363 -0.110
+#> 4 1 4 0.108 0.363 -0.110
+#> 5 1 5 0.108 0.363 -0.110
+#> 6 1 6 0.108 0.363 -0.110
+#> 7 1 7 0.108 0.363 -0.110
+#> 8 1 8 0.108 0.363 -0.110
+#> 9 1 9 0.108 0.363 -0.110
+#> 10 1 10 0.108 0.363 -0.110
#> # i 7,990 more rows
#> # i 19 more variables: `inv.Ka(inv==2)` <dbl>, `eye.Cl(eye==1)` <dbl>,
#> # `eye.Cl(eye==2)` <dbl>, `eye.Ka(eye==1)` <dbl>, `eye.Ka(eye==2)` <dbl>,
@@ -435,17 +433,17 @@ Solving the problem#>
#> -- First part of data (object): --
#> # A tibble: 976,000 x 21
-#> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2 C3
-#> <int> <int> [h] <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 1 0 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 0 0
-#> 2 1 1 0.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 1.24 0.00724
-#> 3 1 1 4 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 16.5 5.02
-#> 4 1 1 4.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 32.3 5.15
-#> 5 1 1 8 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 21.8 8.35
-#> 6 1 1 8.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 12.6 8.40
+#> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2
+#> <int> <int> [h] <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 1 0 0.108 -0.110 0.432 0.586 -0.0881 0.0304 0
+#> 2 1 1 0.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -18.9
+#> 3 1 1 4 0.108 -0.110 0.432 0.586 -0.0881 0.0304 -847.
+#> 4 1 1 4.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -715.
+#> 5 1 1 8 0.108 -0.110 0.432 0.586 -0.0881 0.0304 -3785.
+#> 6 1 1 8.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -4970.
#> # i 975,994 more rows
-#> # i 10 more variables: CL <dbl>, KA <dbl>, ef0 <dbl>, depot <dbl>, centr <dbl>,
-#> # peri <dbl>, eff <dbl>, occ <fct>, eye <fct>, inv <fct>
+#> # i 11 more variables: C3 <dbl>, CL <dbl>, KA <dbl>, ef0 <dbl>, depot <dbl>,
+#> # centr <dbl>, peri <dbl>, eff <dbl>, occ <fct>, eye <fct>, inv <fct>
There are multiple investigators in a study; Each investigator has a
number of individuals enrolled at their site. rxode2
automatically determines the number of investigators and then will
@@ -464,63 +462,63 @@
Solving the problem
print(head(s$params))
#> sim.id id inv.Cl(inv==1) inv.Cl(inv==2) inv.Ka(inv==1) inv.Ka(inv==2)
-#> 1 1 1 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 2 1 2 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 3 1 3 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 4 1 4 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 5 1 5 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 6 1 6 -0.03903519 -0.0402308 -0.09422733 -0.2222389
+#> 1 1 1 0.1082821 0.3626882 -0.109708 0.09798624
+#> 2 1 2 0.1082821 0.3626882 -0.109708 0.09798624
+#> 3 1 3 0.1082821 0.3626882 -0.109708 0.09798624
+#> 4 1 4 0.1082821 0.3626882 -0.109708 0.09798624
+#> 5 1 5 0.1082821 0.3626882 -0.109708 0.09798624
+#> 6 1 6 0.1082821 0.3626882 -0.109708 0.09798624
#> eye.Cl(eye==1) eye.Cl(eye==2) eye.Ka(eye==1) eye.Ka(eye==2) iov.Cl(occ==1)
-#> 1 0.29091811 -0.01542317 0.07258091 0.34505211 0.01684535
-#> 2 -0.14901624 -0.38252332 0.03616125 -0.02581829 -0.01951429
-#> 3 0.04366161 0.04893422 0.34442986 0.05949640 0.02975505
-#> 4 0.53381517 -0.23612630 0.02020768 0.13279331 -0.14357799
-#> 5 0.10876531 -0.01837668 -0.07839463 0.66759002 -0.11951379
-#> 6 0.29345370 -0.16347273 0.16696714 -0.21050912 0.13931739
-#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
-#> 1 0.0676210373 0.02665256 -0.05464559 40.19573 297.5459 19.14549
-#> 2 -0.0001926847 0.08155886 -0.10087830 40.19573 297.5459 19.14549
-#> 3 0.0807252964 0.06784367 0.20606147 40.19573 297.5459 19.14549
-#> 4 0.1841479804 0.02825059 -0.03639285 40.19573 297.5459 19.14549
-#> 5 0.0481570368 -0.16042582 -0.03872286 40.19573 297.5459 19.14549
-#> 6 -0.0201587971 -0.03760217 -0.11540276 40.19573 297.5459 19.14549
-#> eta.Cl TKA eta.Ka Q Kin Kout EC50
-#> 1 -0.01012319 0.1951491 -0.12653552 10.49742 0.7229821 0.749676 200.0693
-#> 2 -0.61749725 0.1951491 0.13550157 10.49742 0.7229821 0.749676 200.0693
-#> 3 0.28943517 0.1951491 0.08638813 10.49742 0.7229821 0.749676 200.0693
-#> 4 -0.32822614 0.1951491 -0.39633056 10.49742 0.7229821 0.749676 200.0693
-#> 5 -0.06070510 0.1951491 -0.47385633 10.49742 0.7229821 0.749676 200.0693
-#> 6 0.32947559 0.1951491 -0.12152307 10.49742 0.7229821 0.749676 200.0693
+#> 1 0.43197371 -0.058328678 0.586264966 0.174884342 -0.08811714
+#> 2 0.08559430 0.006108123 -0.005624186 -0.020710794 0.10637721
+#> 3 0.02708297 -0.001796112 0.240805194 0.009550938 0.06595025
+#> 4 0.09386198 -0.239239291 -0.079574652 0.004080677 0.23965275
+#> 5 -0.03540689 -0.032725874 0.209994611 -0.246674424 0.02757919
+#> 6 0.44890673 -0.325267423 -0.024517791 -0.050395249 -0.14357516
+#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
+#> 1 0.07218375 0.03039623 0.067693210 39.90301 297.153 18.10281
+#> 2 0.02406445 0.03465175 0.169113740 39.90301 297.153 18.10281
+#> 3 0.07833762 0.16896481 0.083329437 39.90301 297.153 18.10281
+#> 4 0.09014535 0.16781970 -0.007580041 39.90301 297.153 18.10281
+#> 5 -0.02744128 -0.05331629 0.123470046 39.90301 297.153 18.10281
+#> 6 0.14006037 0.16503842 -0.069874068 39.90301 297.153 18.10281
+#> eta.Cl TKA eta.Ka Q Kin Kout EC50
+#> 1 0.3276499 -0.3669389 0.1976122 10.56335 0.9466661 1.471005 199.9767
+#> 2 -0.1956677 -0.3669389 -0.4448090 10.56335 0.9466661 1.471005 199.9767
+#> 3 -0.7690862 -0.3669389 0.4423792 10.56335 0.9466661 1.471005 199.9767
+#> 4 -0.2558634 -0.3669389 -0.2013753 10.56335 0.9466661 1.471005 199.9767
+#> 5 -0.6370408 -0.3669389 -0.2217999 10.56335 0.9466661 1.471005 199.9767
+#> 6 -0.2844281 -0.3669389 0.2746496 10.56335 0.9466661 1.471005 199.9767
#> sim.id id inv.Cl(inv==1) inv.Cl(inv==2) inv.Ka(inv==1) inv.Ka(inv==2)
-#> 1 2 1 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 2 2 2 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 3 2 3 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 4 2 4 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 5 2 5 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 6 2 6 -0.04491481 -0.09395214 0.08965191 0.1265575
+#> 1 2 1 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 2 2 2 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 3 2 3 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 4 2 4 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 5 2 5 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 6 2 6 -0.2185114 0.1578254 -0.06550178 0.01692558
#> eye.Cl(eye==1) eye.Cl(eye==2) eye.Ka(eye==1) eye.Ka(eye==2) iov.Cl(occ==1)
-#> 1 -0.32697281 0.05799824 0.05028534 0.302033419 -0.10995295
-#> 2 -0.02159235 0.06495060 0.28662841 0.061231871 -0.03617266
-#> 3 -0.30216008 0.17484210 -0.03947689 -0.050076485 -0.07469975
-#> 4 0.15415822 -0.12064344 -0.29445326 -0.185026088 -0.11227958
-#> 5 0.09671987 -0.08665433 -0.07282272 -0.241574148 -0.17869466
-#> 6 0.05892414 -0.15623698 -0.08837725 0.006157003 0.15371362
-#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
-#> 1 -0.112893048 0.098532914 0.05867914 41.14554 297.2317 19.29969
-#> 2 -0.003219473 -0.258834701 -0.07328102 41.14554 297.2317 19.29969
-#> 3 -0.163476114 -0.141774495 -0.03129942 41.14554 297.2317 19.29969
-#> 4 0.145940005 -0.008140622 -0.07572177 41.14554 297.2317 19.29969
-#> 5 -0.098236212 0.064253865 -0.03018284 41.14554 297.2317 19.29969
-#> 6 0.065147255 -0.078717810 0.05578569 41.14554 297.2317 19.29969
-#> eta.Cl TKA eta.Ka Q Kin Kout EC50
-#> 1 0.1955688 -0.145662 -0.37850798 10.31685 1.759972 1.026146 199.8189
-#> 2 0.5163013 -0.145662 0.01158123 10.31685 1.759972 1.026146 199.8189
-#> 3 -0.2067334 -0.145662 -0.38842622 10.31685 1.759972 1.026146 199.8189
-#> 4 0.1474554 -0.145662 -0.17572677 10.31685 1.759972 1.026146 199.8189
-#> 5 -0.4601038 -0.145662 -0.43805881 10.31685 1.759972 1.026146 199.8189
-#> 6 0.4399962 -0.145662 0.12118850 10.31685 1.759972 1.026146 199.8189
+#> 1 -0.28983275 0.23313282 0.054875269 -0.10816332 0.03378266
+#> 2 0.17133543 -0.09585557 -0.018382439 0.03009169 -0.03036841
+#> 3 -0.04487519 -0.10519202 0.300869327 0.13375274 0.05674318
+#> 4 0.19924316 0.02586329 -0.109179227 0.22221001 0.06869933
+#> 5 -0.05895218 -0.28987217 -0.007452707 -0.03639888 -0.03700882
+#> 6 0.18030544 -0.37938212 0.270230738 -0.15310814 -0.15591525
+#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
+#> 1 0.05942611 0.02503154 -0.11716174 39.484 297.4703 18.23602
+#> 2 0.07854405 0.12953177 0.08902964 39.484 297.4703 18.23602
+#> 3 -0.05471371 0.04489170 -0.01115435 39.484 297.4703 18.23602
+#> 4 0.01822086 0.29324185 0.09084004 39.484 297.4703 18.23602
+#> 5 -0.16679912 0.03565972 0.05666132 39.484 297.4703 18.23602
+#> 6 0.11982797 0.11883012 -0.01873016 39.484 297.4703 18.23602
+#> eta.Cl TKA eta.Ka Q Kin Kout EC50
+#> 1 -0.2606673 0.4157218 -0.113167108 10.59193 0.7312587 1.12052 200.1582
+#> 2 0.4088169 0.4157218 0.494133531 10.59193 0.7312587 1.12052 200.1582
+#> 3 -0.2175045 0.4157218 -0.002530923 10.59193 0.7312587 1.12052 200.1582
+#> 4 0.5150686 0.4157218 -0.121588025 10.59193 0.7312587 1.12052 200.1582
+#> 5 0.3760662 0.4157218 0.218664584 10.59193 0.7312587 1.12052 200.1582
+#> 6 0.3092382 0.4157218 0.065845127 10.59193 0.7312587 1.12052 200.1582
For between eye variability and between occasion variability each
individual simulates a number of variables that become the between eye
and between occasion variability; In the case of the eye:
diff --git a/articles/rxode2-pipeline.html b/articles/rxode2-pipeline.html
index aab3ee0a0..e5676442f 100644
--- a/articles/rxode2-pipeline.html
+++ b/articles/rxode2-pipeline.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 in a pipeline
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-pipeline.Rmd
rxode2-pipeline.Rmd
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png
index d20d9935e..74812e697 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png
index 9f221e139..1b13ea7f4 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png
index 16f19118f..15a78c504 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png
index 7619970c3..296567987 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png
index e5c6b755b..f61055b46 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png
index f794c6432..b938009fb 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png
index 5c179b1a3..40b0f3fbc 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-plot.html b/articles/rxode2-plot.html
index 01225ff7e..e06602924 100644
--- a/articles/rxode2-plot.html
+++ b/articles/rxode2-plot.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-plot.Rmd
rxode2-plot.Rmd
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png
index 0a6560d2d..aa962183e 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png
index 76266c0ae..5b830abc3 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png
index 0efe09130..56735d09b 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png
index cb9f763d1..ce62c6d38 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png
index 7f18b4fbd..6436e5c7e 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png
index cad1f1933..7384b4f91 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png
index 26b265d95..3a5ab4007 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-prior-data.html b/articles/rxode2-prior-data.html
index 41a2496ff..79aa0815f 100644
--- a/articles/rxode2-prior-data.html
+++ b/articles/rxode2-prior-data.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Using Prior Data for ODE solving
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-prior-data.Rmd
rxode2-prior-data.Rmd
@@ -242,33 +242,33 @@ Using prior data for solving#> ── Solved rxode2 object ──
#> ── Parameters ($params): ──
#> # A tibble: 12 × 7
-#> id tka tcl tv eta.ka eta.cl eta.v
-#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0.451 1.02 3.45 0.0844 -0.366 -0.129
-#> 2 2 0.451 1.02 3.45 0.286 -0.223 -0.00544
-#> 3 3 0.451 1.02 3.45 1.38 -0.258 -0.0442
-#> 4 4 0.451 1.02 3.45 0.745 -0.228 0.162
-#> 5 5 0.451 1.02 3.45 0.384 -0.000858 0.0493
-#> 6 6 0.451 1.02 3.45 -2.45 0.442 0.305
-#> 7 7 0.451 1.02 3.45 0.524 -0.784 0.0160
-#> 8 8 0.451 1.02 3.45 0.0609 -0.117 -0.233
-#> 9 9 0.451 1.02 3.45 -0.750 -0.370 -0.457
-#> 10 10 0.451 1.02 3.45 0.0168 0.101 0.0964
-#> 11 11 0.451 1.02 3.45 0.248 -0.233 0.112
-#> 12 12 0.451 1.02 3.45 0.157 0.127 -0.591
+#> id tka tcl tv eta.ka eta.cl eta.v
+#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 0.451 1.02 3.45 -0.431 0.185 0.143
+#> 2 2 0.451 1.02 3.45 0.0585 -0.518 -0.127
+#> 3 3 0.451 1.02 3.45 0.710 -0.180 -0.130
+#> 4 4 0.451 1.02 3.45 1.16 0.0582 0.230
+#> 5 5 0.451 1.02 3.45 0.406 0.227 -0.0981
+#> 6 6 0.451 1.02 3.45 0.0960 0.0544 -0.658
+#> 7 7 0.451 1.02 3.45 -0.0790 0.519 0.0537
+#> 8 8 0.451 1.02 3.45 -1.70 -0.670 -0.118
+#> 9 9 0.451 1.02 3.45 -0.582 -0.546 -0.305
+#> 10 10 0.451 1.02 3.45 -0.275 -0.303 -0.298
+#> 11 11 0.451 1.02 3.45 0.564 -0.245 0.00526
+#> 12 12 0.451 1.02 3.45 0.126 0.353 0.211
#> ── Initial Conditions ($inits): ──
#> depot center
#> 0 0
#> ── First part of data (object): ──
#> # A tibble: 132 × 8
-#> id time ka cl v cp depot center
-#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0 1.71 1.92 27.7 0 320. 0
-#> 2 1 0.25 1.71 1.92 27.7 3.98 209. 110.
-#> 3 1 0.57 1.71 1.92 27.7 7.04 121. 195.
-#> 4 1 1.12 1.71 1.92 27.7 9.38 47.2 259.
-#> 5 1 2.02 1.71 1.92 27.7 10.1 10.2 279.
-#> 6 1 3.82 1.71 1.92 27.7 9.24 0.469 255.
+#> id time ka cl v cp depot center
+#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 0 1.02 3.33 36.3 0 320. 0
+#> 2 1 0.25 1.02 3.33 36.3 1.96 248. 71.2
+#> 3 1 0.57 1.02 3.33 36.3 3.78 179. 137.
+#> 4 1 1.12 1.02 3.33 36.3 5.65 102. 205.
+#> 5 1 2.02 1.02 3.33 36.3 6.81 40.8 247.
+#> 6 1 3.82 1.02 3.33 36.3 6.63 6.50 241.
#> # ℹ 126 more rows
## Of course the fasest way to solve if you don't care about the rxode2 extra parameters is
@@ -282,31 +282,31 @@ Using prior data for solving#> # A tibble: 132 × 8
#> id time ka cl v cp depot center
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0 1.90 3.99 45.5 0 3.20e+2 0
-#> 2 1 0.25 1.90 3.99 45.5 2.62 1.99e+2 119.
-#> 3 1 0.57 1.90 3.99 45.5 4.51 1.09e+2 205.
-#> 4 1 1.12 1.90 3.99 45.5 5.80 3.83e+1 264.
-#> 5 1 2.02 1.90 3.99 45.5 6.02 6.96e+0 274.
-#> 6 1 3.82 1.90 3.99 45.5 5.27 2.30e-1 240.
-#> 7 1 5.1 1.90 3.99 45.5 4.72 2.03e-2 215.
-#> 8 1 7.03 1.90 3.99 45.5 3.98 5.24e-4 181.
-#> 9 1 9.05 1.90 3.99 45.5 3.34 1.14e-5 152.
-#> 10 1 12.1 1.90 3.99 45.5 2.55 3.37e-8 116.
+#> 1 1 0 2.30 1.43 38.7 0 3.20e+2 0
+#> 2 1 0.25 2.30 1.43 38.7 3.60 1.80e+2 139.
+#> 3 1 0.57 2.30 1.43 38.7 5.96 8.62e+1 231.
+#> 4 1 1.12 2.30 1.43 38.7 7.42 2.43e+1 287.
+#> 5 1 2.02 2.30 1.43 38.7 7.72 3.07e+0 299.
+#> 6 1 3.82 2.30 1.43 38.7 7.30 4.87e-2 282.
+#> 7 1 5.1 2.30 1.43 38.7 6.96 2.56e-3 269.
+#> 8 1 7.03 2.30 1.43 38.7 6.48 3.02e-5 251.
+#> 9 1 9.05 2.30 1.43 38.7 6.02 2.89e-7 233.
+#> 10 1 12.1 2.30 1.43 38.7 5.37 1.54e-9 208.
#> # ℹ 122 more rows
data.table::data.table(solveData)
-#> id time ka cl v cp depot center
-#> 1: 1 0.00 1.895099 3.987523 45.47526 0.0000000 3.199920e+02 0.00000
-#> 2: 1 0.25 1.895099 3.987523 45.47526 2.6241287 1.992422e+02 119.33294
-#> 3: 1 0.57 1.895099 3.987523 45.47526 4.5132815 1.086455e+02 205.24265
-#> 4: 1 1.12 1.895099 3.987523 45.47526 5.8044894 3.831280e+01 263.96067
-#> 5: 1 2.02 1.895099 3.987523 45.47526 6.0198854 6.960095e+00 273.75586
-#> ---
-#> 128: 12 5.07 4.299781 2.744429 25.14956 7.5229329 1.098088e-07 189.19843
-#> 129: 12 7.07 4.299781 2.744429 25.14956 6.0478778 -1.176117e-09 152.10145
-#> 130: 12 9.03 4.299781 2.744429 25.14956 4.8833079 -2.115089e-09 122.81303
-#> 131: 12 12.05 4.299781 2.744429 25.14956 3.5122972 2.455099e-09 88.33272
-#> 132: 12 24.15 4.299781 2.744429 25.14956 0.9378821 1.006647e-08 23.58732
+#> id time ka cl v cp depot center
+#> 1: 1 0.00 2.300935 1.427091 38.71162 0.000000 3.199920e+02 0.00000
+#> 2: 1 0.25 2.300935 1.427091 38.71162 3.597596 1.800190e+02 139.26877
+#> 3: 1 0.57 2.300935 1.427091 38.71162 5.962771 8.620795e+01 230.82849
+#> 4: 1 1.12 2.300935 1.427091 38.71162 7.422420 2.431874e+01 287.33387
+#> 5: 1 2.02 2.300935 1.427091 38.71162 7.717302 3.066092e+00 298.74922
+#> ---
+#> 128: 12 5.07 2.042580 3.811162 47.41169 4.683446 1.019822e-02 222.05007
+#> 129: 12 7.07 2.042580 3.811162 47.41169 3.988089 1.715374e-04 189.08201
+#> 130: 12 9.03 2.042580 3.811162 47.41169 3.406753 3.130922e-06 161.51988
+#> 131: 12 12.05 2.042580 3.811162 47.41169 2.672458 6.357558e-09 126.70572
+#> 132: 12 24.15 2.042580 3.811162 47.41169 1.010399 -4.063231e-09 47.90474
diff --git a/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png b/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png
index 5e38bf699..0e2548395 100644
Binary files a/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png and b/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/articles/rxode2-rxUse.html b/articles/rxode2-rxUse.html
index a7226d7f9..7a9a1d2f8 100644
--- a/articles/rxode2-rxUse.html
+++ b/articles/rxode2-rxUse.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-rxUse.Rmd
rxode2-rxUse.Rmd
diff --git a/articles/rxode2-shiny.html b/articles/rxode2-shiny.html
index a7b3cf592..71879b2fd 100644
--- a/articles/rxode2-shiny.html
+++ b/articles/rxode2-shiny.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 and Shiny
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-shiny.Rmd
rxode2-shiny.Rmd
diff --git a/articles/rxode2-sim-var.html b/articles/rxode2-sim-var.html
index e3dd49b16..597a80bec 100644
--- a/articles/rxode2-sim-var.html
+++ b/articles/rxode2-sim-var.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Simulation
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-sim-var.Rmd
rxode2-sim-var.Rmd
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png
index 0801c48a3..325135031 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png
index f7cbf10f8..932ad602a 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png
index 801724856..49e70f3bd 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png
index 112f6e4e1..c09ce5fdd 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png
index 04bfe7386..9e5b3aa40 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png
index a9d3e17ba..437525a0c 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png
index b373a4f5a..9cddd37c3 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png
index 46ac7e26c..110471fd9 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png
index 6cd5d0ec2..7b24abb7c 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png
index a1d57649e..21d84dbd8 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png
index f529935b6..aa1d958e8 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-single-subject.html b/articles/rxode2-single-subject.html
index e96a41222..106cf7665 100644
--- a/articles/rxode2-single-subject.html
+++ b/articles/rxode2-single-subject.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Single Subject ODE solving -- differences from multiple subject
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-single-subject.Rmd
rxode2-single-subject.Rmd
diff --git a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png
index fba81cd7f..74fab59ec 100644
Binary files a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png and b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png
index 4415e8355..d08312dc4 100644
Binary files a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-speed.html b/articles/rxode2-speed.html
index d17010558..fe369dd6a 100644
--- a/articles/rxode2-speed.html
+++ b/articles/rxode2-speed.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-speed.Rmd
rxode2-speed.Rmd
@@ -262,8 +262,8 @@ A note about t
output. You can see the differences below:
summary(mod1$simulationModel)
-#> rxode2 2.0.14.9000 model named rx_1db0dc8e0f01971bbf76da7db21b2ddc model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_1db0dc8e0f01971bbf76da7db21b2ddc__.rxd/rx_1db0dc8e0f01971bbf76da7db21b2ddc_.so
+#> rxode2 2.0.14.9000 model named rx_dc699e1c896b208ee1d2c3d40f0517f6 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_dc699e1c896b208ee1d2c3d40f0517f6__.rxd/rx_dc699e1c896b208ee1d2c3d40f0517f6_.so
#> NULL
#>
#> Calculated Variables:
@@ -281,8 +281,8 @@ A note about t
#> })
summary(mod1$simulationIniModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_5a1faf720b150ea8bf052c9e377d3541 model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_5a1faf720b150ea8bf052c9e377d3541__.rxd/rx_5a1faf720b150ea8bf052c9e377d3541_.so
+#> rxode2 2.0.14.9000 model named rx_a70bc38d73df7fd8798a4d16d23549b7 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_a70bc38d73df7fd8798a4d16d23549b7__.rxd/rx_a70bc38d73df7fd8798a4d16d23549b7_.so
#> NULL
#>
#> Calculated Variables:
@@ -308,8 +308,8 @@ A note about t
#> })
summary(mod2$simulationModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_89c321f08eb652c4c20174fabb507c1a model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_89c321f08eb652c4c20174fabb507c1a__.rxd/rx_89c321f08eb652c4c20174fabb507c1a_.so
+#> rxode2 2.0.14.9000 model named rx_4f35e2e99d243ab6809555688909b8b5 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_4f35e2e99d243ab6809555688909b8b5__.rxd/rx_4f35e2e99d243ab6809555688909b8b5_.so
#> NULL
#>
#> Calculated Variables:
@@ -365,8 +365,8 @@ A note about t
#> })
summary(mod2$simulationIniModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_2df8872b4615f9e177c35609e2b4f0ac model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_2df8872b4615f9e177c35609e2b4f0ac__.rxd/rx_2df8872b4615f9e177c35609e2b4f0ac_.so
+#> rxode2 2.0.14.9000 model named rx_6e671c0a1d256755528eea1281ce8326 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_6e671c0a1d256755528eea1281ce8326__.rxd/rx_6e671c0a1d256755528eea1281ce8326_.so
#> NULL
#>
#> Calculated Variables:
@@ -552,10 +552,10 @@ Compare the times between all
print(bench)
#> Unit: milliseconds
#> expr min lq mean median uq max
-#> runFor() 276.22910 280.46886 291.73762 283.01823 286.89760 451.35924
-#> runSapply() 275.08853 280.51578 290.80704 282.79888 287.13135 398.02833
-#> runSingleThread() 30.18147 30.41170 32.09662 30.53664 30.91048 54.01280
-#> run2Thread() 17.77206 18.07482 19.55270 18.23813 18.59497 33.42291
+#> runFor() 270.69599 276.55658 287.34527 279.04749 283.91232 399.33829
+#> runSapply() 270.92489 277.10728 286.33457 279.31426 284.37742 395.99029
+#> runSingleThread() 28.37033 28.55639 29.56166 28.67460 28.90486 47.37217
+#> run2Thread() 16.90444 17.11417 18.66124 17.29484 17.65497 29.40771
#> neval
#> 100
#> 100
@@ -582,10 +582,10 @@ Compare the times between all
print(bench)
#> Unit: milliseconds
#> expr min lq mean median uq max neval
-#> runThread(1) 30.11232 30.44157 32.17729 30.87135 31.89442 53.22333 100
-#> runThread(2) 18.01286 18.35992 20.01757 19.03389 19.27335 30.26586 100
-#> runThread(3) 19.16968 20.63224 21.16056 20.88685 21.64686 26.72507 100
-#> runThread(4) 17.32244 17.52879 19.31132 18.24037 18.41109 33.27417 100
+#> runThread(1) 28.50206 28.80758 30.07428 29.76448 30.28849 51.17343 100
+#> runThread(2) 16.99616 17.40397 19.68778 18.00946 19.60652 29.88473 100
+#> runThread(3) 18.74504 19.83795 20.51225 20.06909 20.67744 28.24697 100
+#> runThread(4) 16.64245 16.94800 19.28947 17.38783 17.77615 38.09974 100
autoplot(bench)
@@ -675,7 +675,7 @@ A real life exampleStoplapply <- Sys.time()
print(Stoplapply - Startlapply)
-#> Time difference of 12.63246 secs
+#> Time difference of 12.56756 secs
By applying some of the new parallel solving concepts you can simply
run the same simulation both with less code and faster:
@@ -716,7 +716,7 @@ A real life exampleres <- rxSolve(rx, ev, omega=omega, returnType="data.table")
endParallel <- Sys.time()
print(endParallel - startParallel)
-#> Time difference of 0.1095562 secs
+#> Time difference of 0.1166935 secs
You can see a striking time difference between the two methods; A few
things to keep in mind:
+#> [1] gtable_0.3.4 xfun_0.41 bslib_0.6.1
+#> [4] RApiSerialize_0.1.2 lattice_0.21-9 vctrs_0.6.4
+#> [7] tools_4.3.2 generics_0.1.3 tibble_3.2.1
+#> [10] symengine_0.2.2 fansi_1.0.5 highr_0.10
+#> [13] pkgconfig_2.0.3 checkmate_2.3.0 desc_1.4.2
+#> [16] RcppParallel_5.1.7 lifecycle_1.0.4 compiler_4.3.2
+#> [19] farver_2.1.1 stringr_1.5.1 textshaping_0.3.7
+#> [22] munsell_0.5.0 qs_0.25.6 htmltools_0.5.7
+#> [25] sys_3.4.2 sass_0.4.7 yaml_2.3.7
+#> [28] lazyeval_0.2.2 pillar_1.9.0 pkgdown_2.0.7
+#> [31] crayon_1.5.2 jquerylib_0.1.4 cachem_1.0.8
+#> [34] nlme_3.1-163 tidyselect_1.2.0 digest_0.6.33
+#> [37] lotri_0.4.4 stringi_1.8.2 dplyr_1.1.4
+#> [40] purrr_1.0.2 rxode2ll_2.0.11.9000 rprojroot_2.0.4
+#> [43] fastmap_1.1.1 grid_4.3.2 colorspace_2.1-0
+#> [46] rxode2parse_2.0.17 cli_3.6.1 dparser_1.3.1-11
+#> [49] magrittr_2.0.3 utf8_1.2.4 withr_2.5.2
+#> [52] scales_1.3.0 backports_1.4.1 rmarkdown_2.25
+#> [55] ragg_1.2.6 stringfish_0.16.0 memoise_2.0.1
+#> [58] evaluate_0.23 knitr_1.45 rex_1.2.1
+#> [61] rxode2et_2.0.11 rxode2random_2.0.12 PreciseSums_0.6
+#> [64] rlang_1.1.2 Rcpp_1.0.11 glue_1.6.2
+#> [67] jsonlite_1.8.7 R6_2.5.1 systemfonts_1.0.5
+#> [70] fs_1.6.3 units_0.8-5
diff --git a/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5 b/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5
new file mode 100644
index 000000000..8a5809ff2
--- /dev/null
+++ b/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5
@@ -0,0 +1 @@
+rxode2
diff --git a/reference/myapp/mod1.d/mod1_.c b/reference/myapp/mod1.d/mod1_.c
index b641e5e35..4ab3a7415 100644
--- a/reference/myapp/mod1.d/mod1_.c
+++ b/reference/myapp/mod1.d/mod1_.c
@@ -1,119 +1,119 @@
-#define _getRxSolve_ _rxmod1_4d6db176c09140d3e32f433895c79e9f0
-#define _evalUdf _rxmod1_4d6db176c09140d3e32f433895c79e9f1
-#define _solveData _rxmod1_4d6db176c09140d3e32f433895c79e9f2
-#define _assign_ptr _rxmod1_4d6db176c09140d3e32f433895c79e9f3
-#define _rxRmModelLib _rxmod1_4d6db176c09140d3e32f433895c79e9f4
-#define _rxGetModelLib _rxmod1_4d6db176c09140d3e32f433895c79e9f5
-#define _old_c _rxmod1_4d6db176c09140d3e32f433895c79e9f6
-#define _ptrid _rxmod1_4d6db176c09140d3e32f433895c79e9f7
-#define _rxIsCurrentC _rxmod1_4d6db176c09140d3e32f433895c79e9f8
-#define _sumPS _rxmod1_4d6db176c09140d3e32f433895c79e9f9
-#define _prodPS _rxmod1_4d6db176c09140d3e32f433895c79e9f10
-#define _prodType _rxmod1_4d6db176c09140d3e32f433895c79e9f11
-#define _sumType _rxmod1_4d6db176c09140d3e32f433895c79e9f12
-#define _update_par_ptr _rxmod1_4d6db176c09140d3e32f433895c79e9f13
-#define _getParCov _rxmod1_4d6db176c09140d3e32f433895c79e9f14
-#define _rxode2_rxAssignPtr _rxmod1_4d6db176c09140d3e32f433895c79e9f15
-#define _rxQr _rxmod1_4d6db176c09140d3e32f433895c79e9f16
-#define _compareFactorVal _rxmod1_4d6db176c09140d3e32f433895c79e9f17
-#define _sum _rxmod1_4d6db176c09140d3e32f433895c79e9f18
-#define _udf _rxmod1_4d6db176c09140d3e32f433895c79e9f19
-#define _sign _rxmod1_4d6db176c09140d3e32f433895c79e9f20
-#define _prod _rxmod1_4d6db176c09140d3e32f433895c79e9f21
-#define _max _rxmod1_4d6db176c09140d3e32f433895c79e9f22
-#define _min _rxmod1_4d6db176c09140d3e32f433895c79e9f23
-#define _transit4P _rxmod1_4d6db176c09140d3e32f433895c79e9f24
-#define _transit3P _rxmod1_4d6db176c09140d3e32f433895c79e9f25
-#define _assignFuns0 _rxmod1_4d6db176c09140d3e32f433895c79e9f26
-#define _assignFuns _rxmod1_4d6db176c09140d3e32f433895c79e9f27
-#define _rxord _rxmod1_4d6db176c09140d3e32f433895c79e9f28
-#define __assignFuns2 _rxmod1_4d6db176c09140d3e32f433895c79e9f29
-#define _llikCauchyDscale _rxmod1_4d6db176c09140d3e32f433895c79e9f30
-#define _llikCauchyDlocation _rxmod1_4d6db176c09140d3e32f433895c79e9f31
-#define _llikCauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f32
-#define _llikGammaDrate _rxmod1_4d6db176c09140d3e32f433895c79e9f33
-#define _llikGammaDshape _rxmod1_4d6db176c09140d3e32f433895c79e9f34
-#define _llikGamma _rxmod1_4d6db176c09140d3e32f433895c79e9f35
-#define _llikWeibullDscale _rxmod1_4d6db176c09140d3e32f433895c79e9f36
-#define _llikWeibullDshape _rxmod1_4d6db176c09140d3e32f433895c79e9f37
-#define _llikWeibull _rxmod1_4d6db176c09140d3e32f433895c79e9f38
-#define _llikUnifDbeta _rxmod1_4d6db176c09140d3e32f433895c79e9f39
-#define _llikUnifDalpha _rxmod1_4d6db176c09140d3e32f433895c79e9f40
-#define _llikUnif _rxmod1_4d6db176c09140d3e32f433895c79e9f41
-#define _llikGeomDp _rxmod1_4d6db176c09140d3e32f433895c79e9f42
-#define _llikGeom _rxmod1_4d6db176c09140d3e32f433895c79e9f43
-#define _llikFDdf2 _rxmod1_4d6db176c09140d3e32f433895c79e9f44
-#define _llikFDdf1 _rxmod1_4d6db176c09140d3e32f433895c79e9f45
-#define _llikF _rxmod1_4d6db176c09140d3e32f433895c79e9f46
-#define _llikExpDrate _rxmod1_4d6db176c09140d3e32f433895c79e9f47
-#define _llikExp _rxmod1_4d6db176c09140d3e32f433895c79e9f48
-#define _llikChisqDdf _rxmod1_4d6db176c09140d3e32f433895c79e9f49
-#define _llikChisq _rxmod1_4d6db176c09140d3e32f433895c79e9f50
-#define _llikTDsd _rxmod1_4d6db176c09140d3e32f433895c79e9f51
-#define _llikTDmean _rxmod1_4d6db176c09140d3e32f433895c79e9f52
-#define _llikTDdf _rxmod1_4d6db176c09140d3e32f433895c79e9f53
-#define _llikT _rxmod1_4d6db176c09140d3e32f433895c79e9f54
-#define _llikBetaDshape2 _rxmod1_4d6db176c09140d3e32f433895c79e9f55
-#define _llikBetaDshape1 _rxmod1_4d6db176c09140d3e32f433895c79e9f56
-#define _llikBeta _rxmod1_4d6db176c09140d3e32f433895c79e9f57
-#define _llikNbinomMuDmu _rxmod1_4d6db176c09140d3e32f433895c79e9f58
-#define _llikNbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f59
-#define _llikNbinomDprob _rxmod1_4d6db176c09140d3e32f433895c79e9f60
-#define _llikNbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f61
-#define _llikBinomDprob _rxmod1_4d6db176c09140d3e32f433895c79e9f62
-#define _llikBinom _rxmod1_4d6db176c09140d3e32f433895c79e9f63
-#define _llikPoisDlambda _rxmod1_4d6db176c09140d3e32f433895c79e9f64
-#define _llikPois _rxmod1_4d6db176c09140d3e32f433895c79e9f65
-#define _llikNormDsd _rxmod1_4d6db176c09140d3e32f433895c79e9f66
-#define _llikNormDmean _rxmod1_4d6db176c09140d3e32f433895c79e9f67
-#define _llikNorm _rxmod1_4d6db176c09140d3e32f433895c79e9f68
-#define simeps _rxmod1_4d6db176c09140d3e32f433895c79e9f69
-#define simeta _rxmod1_4d6db176c09140d3e32f433895c79e9f70
-#define expit _rxmod1_4d6db176c09140d3e32f433895c79e9f71
-#define logit _rxmod1_4d6db176c09140d3e32f433895c79e9f72
-#define gammapDer _rxmod1_4d6db176c09140d3e32f433895c79e9f73
-#define lowergamma _rxmod1_4d6db176c09140d3e32f433895c79e9f74
-#define uppergamma _rxmod1_4d6db176c09140d3e32f433895c79e9f75
-#define gammaqInva _rxmod1_4d6db176c09140d3e32f433895c79e9f76
-#define gammaqInv _rxmod1_4d6db176c09140d3e32f433895c79e9f77
-#define gammapInva _rxmod1_4d6db176c09140d3e32f433895c79e9f78
-#define gammapInv _rxmod1_4d6db176c09140d3e32f433895c79e9f79
-#define gammaq _rxmod1_4d6db176c09140d3e32f433895c79e9f80
-#define gammap _rxmod1_4d6db176c09140d3e32f433895c79e9f81
-#define phi _rxmod1_4d6db176c09140d3e32f433895c79e9f82
-#define riweibull _rxmod1_4d6db176c09140d3e32f433895c79e9f83
-#define riunif _rxmod1_4d6db176c09140d3e32f433895c79e9f84
-#define rit_ _rxmod1_4d6db176c09140d3e32f433895c79e9f85
-#define ripois _rxmod1_4d6db176c09140d3e32f433895c79e9f86
-#define ribeta _rxmod1_4d6db176c09140d3e32f433895c79e9f87
-#define rigamma _rxmod1_4d6db176c09140d3e32f433895c79e9f88
-#define rigeom _rxmod1_4d6db176c09140d3e32f433895c79e9f89
-#define rif _rxmod1_4d6db176c09140d3e32f433895c79e9f90
-#define riexp _rxmod1_4d6db176c09140d3e32f433895c79e9f91
-#define richisq _rxmod1_4d6db176c09140d3e32f433895c79e9f92
-#define ricauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f93
-#define rinbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f94
-#define rinbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f95
-#define ribinom _rxmod1_4d6db176c09140d3e32f433895c79e9f96
-#define rinorm _rxmod1_4d6db176c09140d3e32f433895c79e9f97
-#define rxweibull _rxmod1_4d6db176c09140d3e32f433895c79e9f98
-#define rxunif _rxmod1_4d6db176c09140d3e32f433895c79e9f99
-#define rxt_ _rxmod1_4d6db176c09140d3e32f433895c79e9f100
-#define rxpois _rxmod1_4d6db176c09140d3e32f433895c79e9f101
-#define rxbeta _rxmod1_4d6db176c09140d3e32f433895c79e9f102
-#define rxgamma _rxmod1_4d6db176c09140d3e32f433895c79e9f103
-#define rxgeom _rxmod1_4d6db176c09140d3e32f433895c79e9f104
-#define rxf _rxmod1_4d6db176c09140d3e32f433895c79e9f105
-#define rxexp _rxmod1_4d6db176c09140d3e32f433895c79e9f106
-#define rxchisq _rxmod1_4d6db176c09140d3e32f433895c79e9f107
-#define rxcauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f108
-#define rxnbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f109
-#define rxnbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f110
-#define rxbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f111
-#define rxnorm _rxmod1_4d6db176c09140d3e32f433895c79e9f112
-#define linCmtC _rxmod1_4d6db176c09140d3e32f433895c79e9f113
-#define linCmtB _rxmod1_4d6db176c09140d3e32f433895c79e9f114
-#define linCmtA _rxmod1_4d6db176c09140d3e32f433895c79e9f115
+#define _getRxSolve_ _rxmod1_fd70789695b9683637113f50a6fda5e90
+#define _evalUdf _rxmod1_fd70789695b9683637113f50a6fda5e91
+#define _solveData _rxmod1_fd70789695b9683637113f50a6fda5e92
+#define _assign_ptr _rxmod1_fd70789695b9683637113f50a6fda5e93
+#define _rxRmModelLib _rxmod1_fd70789695b9683637113f50a6fda5e94
+#define _rxGetModelLib _rxmod1_fd70789695b9683637113f50a6fda5e95
+#define _old_c _rxmod1_fd70789695b9683637113f50a6fda5e96
+#define _ptrid _rxmod1_fd70789695b9683637113f50a6fda5e97
+#define _rxIsCurrentC _rxmod1_fd70789695b9683637113f50a6fda5e98
+#define _sumPS _rxmod1_fd70789695b9683637113f50a6fda5e99
+#define _prodPS _rxmod1_fd70789695b9683637113f50a6fda5e910
+#define _prodType _rxmod1_fd70789695b9683637113f50a6fda5e911
+#define _sumType _rxmod1_fd70789695b9683637113f50a6fda5e912
+#define _update_par_ptr _rxmod1_fd70789695b9683637113f50a6fda5e913
+#define _getParCov _rxmod1_fd70789695b9683637113f50a6fda5e914
+#define _rxode2_rxAssignPtr _rxmod1_fd70789695b9683637113f50a6fda5e915
+#define _rxQr _rxmod1_fd70789695b9683637113f50a6fda5e916
+#define _compareFactorVal _rxmod1_fd70789695b9683637113f50a6fda5e917
+#define _sum _rxmod1_fd70789695b9683637113f50a6fda5e918
+#define _udf _rxmod1_fd70789695b9683637113f50a6fda5e919
+#define _sign _rxmod1_fd70789695b9683637113f50a6fda5e920
+#define _prod _rxmod1_fd70789695b9683637113f50a6fda5e921
+#define _max _rxmod1_fd70789695b9683637113f50a6fda5e922
+#define _min _rxmod1_fd70789695b9683637113f50a6fda5e923
+#define _transit4P _rxmod1_fd70789695b9683637113f50a6fda5e924
+#define _transit3P _rxmod1_fd70789695b9683637113f50a6fda5e925
+#define _assignFuns0 _rxmod1_fd70789695b9683637113f50a6fda5e926
+#define _assignFuns _rxmod1_fd70789695b9683637113f50a6fda5e927
+#define _rxord _rxmod1_fd70789695b9683637113f50a6fda5e928
+#define __assignFuns2 _rxmod1_fd70789695b9683637113f50a6fda5e929
+#define _llikCauchyDscale _rxmod1_fd70789695b9683637113f50a6fda5e930
+#define _llikCauchyDlocation _rxmod1_fd70789695b9683637113f50a6fda5e931
+#define _llikCauchy _rxmod1_fd70789695b9683637113f50a6fda5e932
+#define _llikGammaDrate _rxmod1_fd70789695b9683637113f50a6fda5e933
+#define _llikGammaDshape _rxmod1_fd70789695b9683637113f50a6fda5e934
+#define _llikGamma _rxmod1_fd70789695b9683637113f50a6fda5e935
+#define _llikWeibullDscale _rxmod1_fd70789695b9683637113f50a6fda5e936
+#define _llikWeibullDshape _rxmod1_fd70789695b9683637113f50a6fda5e937
+#define _llikWeibull _rxmod1_fd70789695b9683637113f50a6fda5e938
+#define _llikUnifDbeta _rxmod1_fd70789695b9683637113f50a6fda5e939
+#define _llikUnifDalpha _rxmod1_fd70789695b9683637113f50a6fda5e940
+#define _llikUnif _rxmod1_fd70789695b9683637113f50a6fda5e941
+#define _llikGeomDp _rxmod1_fd70789695b9683637113f50a6fda5e942
+#define _llikGeom _rxmod1_fd70789695b9683637113f50a6fda5e943
+#define _llikFDdf2 _rxmod1_fd70789695b9683637113f50a6fda5e944
+#define _llikFDdf1 _rxmod1_fd70789695b9683637113f50a6fda5e945
+#define _llikF _rxmod1_fd70789695b9683637113f50a6fda5e946
+#define _llikExpDrate _rxmod1_fd70789695b9683637113f50a6fda5e947
+#define _llikExp _rxmod1_fd70789695b9683637113f50a6fda5e948
+#define _llikChisqDdf _rxmod1_fd70789695b9683637113f50a6fda5e949
+#define _llikChisq _rxmod1_fd70789695b9683637113f50a6fda5e950
+#define _llikTDsd _rxmod1_fd70789695b9683637113f50a6fda5e951
+#define _llikTDmean _rxmod1_fd70789695b9683637113f50a6fda5e952
+#define _llikTDdf _rxmod1_fd70789695b9683637113f50a6fda5e953
+#define _llikT _rxmod1_fd70789695b9683637113f50a6fda5e954
+#define _llikBetaDshape2 _rxmod1_fd70789695b9683637113f50a6fda5e955
+#define _llikBetaDshape1 _rxmod1_fd70789695b9683637113f50a6fda5e956
+#define _llikBeta _rxmod1_fd70789695b9683637113f50a6fda5e957
+#define _llikNbinomMuDmu _rxmod1_fd70789695b9683637113f50a6fda5e958
+#define _llikNbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e959
+#define _llikNbinomDprob _rxmod1_fd70789695b9683637113f50a6fda5e960
+#define _llikNbinom _rxmod1_fd70789695b9683637113f50a6fda5e961
+#define _llikBinomDprob _rxmod1_fd70789695b9683637113f50a6fda5e962
+#define _llikBinom _rxmod1_fd70789695b9683637113f50a6fda5e963
+#define _llikPoisDlambda _rxmod1_fd70789695b9683637113f50a6fda5e964
+#define _llikPois _rxmod1_fd70789695b9683637113f50a6fda5e965
+#define _llikNormDsd _rxmod1_fd70789695b9683637113f50a6fda5e966
+#define _llikNormDmean _rxmod1_fd70789695b9683637113f50a6fda5e967
+#define _llikNorm _rxmod1_fd70789695b9683637113f50a6fda5e968
+#define simeps _rxmod1_fd70789695b9683637113f50a6fda5e969
+#define simeta _rxmod1_fd70789695b9683637113f50a6fda5e970
+#define expit _rxmod1_fd70789695b9683637113f50a6fda5e971
+#define logit _rxmod1_fd70789695b9683637113f50a6fda5e972
+#define gammapDer _rxmod1_fd70789695b9683637113f50a6fda5e973
+#define lowergamma _rxmod1_fd70789695b9683637113f50a6fda5e974
+#define uppergamma _rxmod1_fd70789695b9683637113f50a6fda5e975
+#define gammaqInva _rxmod1_fd70789695b9683637113f50a6fda5e976
+#define gammaqInv _rxmod1_fd70789695b9683637113f50a6fda5e977
+#define gammapInva _rxmod1_fd70789695b9683637113f50a6fda5e978
+#define gammapInv _rxmod1_fd70789695b9683637113f50a6fda5e979
+#define gammaq _rxmod1_fd70789695b9683637113f50a6fda5e980
+#define gammap _rxmod1_fd70789695b9683637113f50a6fda5e981
+#define phi _rxmod1_fd70789695b9683637113f50a6fda5e982
+#define riweibull _rxmod1_fd70789695b9683637113f50a6fda5e983
+#define riunif _rxmod1_fd70789695b9683637113f50a6fda5e984
+#define rit_ _rxmod1_fd70789695b9683637113f50a6fda5e985
+#define ripois _rxmod1_fd70789695b9683637113f50a6fda5e986
+#define ribeta _rxmod1_fd70789695b9683637113f50a6fda5e987
+#define rigamma _rxmod1_fd70789695b9683637113f50a6fda5e988
+#define rigeom _rxmod1_fd70789695b9683637113f50a6fda5e989
+#define rif _rxmod1_fd70789695b9683637113f50a6fda5e990
+#define riexp _rxmod1_fd70789695b9683637113f50a6fda5e991
+#define richisq _rxmod1_fd70789695b9683637113f50a6fda5e992
+#define ricauchy _rxmod1_fd70789695b9683637113f50a6fda5e993
+#define rinbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e994
+#define rinbinom _rxmod1_fd70789695b9683637113f50a6fda5e995
+#define ribinom _rxmod1_fd70789695b9683637113f50a6fda5e996
+#define rinorm _rxmod1_fd70789695b9683637113f50a6fda5e997
+#define rxweibull _rxmod1_fd70789695b9683637113f50a6fda5e998
+#define rxunif _rxmod1_fd70789695b9683637113f50a6fda5e999
+#define rxt_ _rxmod1_fd70789695b9683637113f50a6fda5e9100
+#define rxpois _rxmod1_fd70789695b9683637113f50a6fda5e9101
+#define rxbeta _rxmod1_fd70789695b9683637113f50a6fda5e9102
+#define rxgamma _rxmod1_fd70789695b9683637113f50a6fda5e9103
+#define rxgeom _rxmod1_fd70789695b9683637113f50a6fda5e9104
+#define rxf _rxmod1_fd70789695b9683637113f50a6fda5e9105
+#define rxexp _rxmod1_fd70789695b9683637113f50a6fda5e9106
+#define rxchisq _rxmod1_fd70789695b9683637113f50a6fda5e9107
+#define rxcauchy _rxmod1_fd70789695b9683637113f50a6fda5e9108
+#define rxnbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e9109
+#define rxnbinom _rxmod1_fd70789695b9683637113f50a6fda5e9110
+#define rxbinom _rxmod1_fd70789695b9683637113f50a6fda5e9111
+#define rxnorm _rxmod1_fd70789695b9683637113f50a6fda5e9112
+#define linCmtC _rxmod1_fd70789695b9683637113f50a6fda5e9113
+#define linCmtB _rxmod1_fd70789695b9683637113f50a6fda5e9114
+#define linCmtA _rxmod1_fd70789695b9683637113f50a6fda5e9115
#include
#define __MAX_PROD__ 0
#define _CMT CMT
@@ -684,9 +684,9 @@ extern SEXP mod1__model_vars(void){
SEXP _mv = PROTECT(_rxGetModelLib("mod1__model_vars"));pro++;
if (!_rxIsCurrentC(_mv)){
SEXP hash = PROTECT(allocVector(STRSXP, 1));pro++;
-#define __doBuf__ snprintf(buf, __doBufN__, "un]\"BAAA@QRtHACAAAAAAA[9zAAAv7#aT)CY/*MA==@agtVwYBaiiq@CXx4gYeA~%%=DXEl||L*Kwy+HDC1$LfUH3jK=sPx.mU$&q){YP6^F7vuIYimmjiF\?YDtIAkAsB\"iT1{J;CEf\"$HEJf@#j}$%%3o[CL~|N9[5g{To8:{(Mm>M2&Hz5T[F+zp5B(D:7J%%*z9m32|w5\?I;1)7\"HhGT3qJ*!BG\?#BuIk:O28A6o%%H6#l`@>Ck}(`7^Zg%%(&pl7p`b<~jCB@q}EFSO//9%%S`5kdW9R^`iV>ws7$I6$fB}V#kdx)lNj&l&P6)WY0fN*d_!MyIZ]1v\?mK%%<0`_hEgrk\"W!|QOBNCpB%%P7]{!6n9dJWJ}Rw6AS@Z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ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
summary(pbpk)
#> rxode2 2.0.14.9000 model named rx_7ecfe139441efa7d6685fa89a52fedb8 model (ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_7ecfe139441efa7d6685fa89a52fedb8__.rxd/rx_7ecfe139441efa7d6685fa89a52fedb8_.so
+#> rxode2 2.0.14.9000 model named rx_8ee4408c660f4c3f31e6d0548ea2c3f1 model (ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_8ee4408c660f4c3f31e6d0548ea2c3f1__.rxd/rx_8ee4408c660f4c3f31e6d0548ea2c3f1_.so
#> NULL
#>
#> Calculated Variables:
@@ -731,7 +731,7 @@ Appending compartments to the model
ode.1c.ka$simulationModel
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_4851cdb3054ffc2f3e5f53f3896aac57 model (ready).
+#> rxode2 2.0.14.9000 model named rx_b8d999c3e65c274ef9e90ceabef41631 model (ready).
#> x$state: depot, center
#> x$stateExtra: eff
#> x$params: V, KA, CL
diff --git a/articles/rxode2-covariates.html b/articles/rxode2-covariates.html
index 5ecaa6180..e49ea6da6 100644
--- a/articles/rxode2-covariates.html
+++ b/articles/rxode2-covariates.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Covariates
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-covariates.Rmd
rxode2-covariates.Rmd
diff --git a/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png b/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png
index d85292221..8ae60b143 100644
Binary files a/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png and b/articles/rxode2-covariates_files/figure-html/individual-covariates-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png
index d36458f5c..76ed723b0 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-constant-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png
index e83e147dd..3f0acbfc0 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-constant-effect-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png
index 1ea7748c9..2e1e759ef 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-linear-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png
index 158b60465..31e5946fc 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-central-1.png differ
diff --git a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png
index c260fb8b5..7a5ff354a 100644
Binary files a/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png and b/articles/rxode2-covariates_files/figure-html/time-varying-nocb-effect-1.png differ
diff --git a/articles/rxode2-data-frame.html b/articles/rxode2-data-frame.html
index 31553e199..879f804d1 100644
--- a/articles/rxode2-data-frame.html
+++ b/articles/rxode2-data-frame.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Data Frames
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-data-frame.Rmd
rxode2-data-frame.Rmd
diff --git a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png
index f946e5dbd..b947d1e02 100644
Binary files a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png
index 796b3dcbc..ca1b4149e 100644
Binary files a/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-data-frame_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-datasets.html b/articles/rxode2-datasets.html
index 6186fd732..213285710 100644
--- a/articles/rxode2-datasets.html
+++ b/articles/rxode2-datasets.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Event Types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-datasets.Rmd
rxode2-datasets.Rmd
diff --git a/articles/rxode2-event-table.html b/articles/rxode2-event-table.html
index cc34a38bb..6a6393e4b 100644
--- a/articles/rxode2-event-table.html
+++ b/articles/rxode2-event-table.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Easy rxode2 Event Tables
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-event-table.Rmd
rxode2-event-table.Rmd
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png
index 3f37650e8..950911089 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png
index ac02c2a58..cd9bc110d 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png
index 06c65fbab..1f953c6ab 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png
index ba0a9f9c7..c0a458664 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-17-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png
index a5ea8e544..a1400e752 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-19-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png
index f5c7d5c27..6dd88ebb3 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-20-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png
index d647f5766..bf111cc94 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png
index 4844868a8..045225f2c 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-22-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png
index 15c4b64a6..e48bd33b9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png
index 15c4b64a6..e48bd33b9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-24-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png
index 397029275..3701a8a3e 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-25-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png
index 22a53879b..776f2349c 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-26-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png
index 45d6ea873..44a29d9e9 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-27-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png
index e5eb8feee..acf5935f1 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-28-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png
index 942e1e747..2bf995a6f 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png
index 9c8a77537..4411ecf72 100644
Binary files a/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-event-table_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-event-types.html b/articles/rxode2-event-types.html
index 91bcc3171..80a148f68 100644
--- a/articles/rxode2-event-types.html
+++ b/articles/rxode2-event-types.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Event Types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-event-types.Rmd
rxode2-event-types.Rmd
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png
index 616c3c4c7..fae451094 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png
index f085a6d3f..9132c5d20 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-22-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png
index 714dfd3c0..f9e9054d3 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png
index 0876e81fe..3d2c1d615 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-25-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png
index 5ba7c06ee..ae3dacfdc 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-27-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png
index 229686692..a93181c4b 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png
index 435fba88d..b9221b1c1 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-30-1.png differ
diff --git a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png
index 290d044b6..bc556eb03 100644
Binary files a/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png and b/articles/rxode2-event-types_files/figure-html/unnamed-chunk-31-1.png differ
diff --git a/articles/rxode2-events-classic.html b/articles/rxode2-events-classic.html
index 9a674057e..a435b5ee6 100644
--- a/articles/rxode2-events-classic.html
+++ b/articles/rxode2-events-classic.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Classic rxode2 Events
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-events-classic.Rmd
rxode2-events-classic.Rmd
diff --git a/articles/rxode2-intro.html b/articles/rxode2-intro.html
index 3108965c3..2197dcfd1 100644
--- a/articles/rxode2-intro.html
+++ b/articles/rxode2-intro.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Introduction to rxode2
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-intro.Rmd
rxode2-intro.Rmd
diff --git a/articles/rxode2-intro_files/figure-html/intro-central-1.png b/articles/rxode2-intro_files/figure-html/intro-central-1.png
index 46963448a..5ef865e59 100644
Binary files a/articles/rxode2-intro_files/figure-html/intro-central-1.png and b/articles/rxode2-intro_files/figure-html/intro-central-1.png differ
diff --git a/articles/rxode2-intro_files/figure-html/intro-effect-1.png b/articles/rxode2-intro_files/figure-html/intro-effect-1.png
index 90229dc81..718f7961e 100644
Binary files a/articles/rxode2-intro_files/figure-html/intro-effect-1.png and b/articles/rxode2-intro_files/figure-html/intro-effect-1.png differ
diff --git a/articles/rxode2-model-types.html b/articles/rxode2-model-types.html
index cd56c4534..3d801b195 100644
--- a/articles/rxode2-model-types.html
+++ b/articles/rxode2-model-types.html
@@ -157,12 +157,12 @@ Advanced Features, Model Types, Techni
-
-
+
+
rxode2 additional model types
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-model-types.Rmd
rxode2-model-types.Rmd
@@ -237,18 +237,18 @@ Solved compartment modelsVC or V
),
Peripheral/Tissue (VP
, VT
). While more
translations are available, some example translations are below:
-
-Another popular parameterization is in terms of micro-constants.
+
+Another popular parameterization is in terms of micro-constants.
rxode2 assumes compartment 1
is the central compartment.
The elimination constant would be specified by K
,
Ke
or Kel
. Some example translations are
below:
-
-The last parameterization possible is using alpha
and
+
+The last parameterization possible is using alpha
and
V
and/or A
/B
/C
. Some
example translations are below:
-
-Once the linCmt()
sleuthing is complete, the
+
+Once the linCmt()
sleuthing is complete, the
1
, 2
or 3
compartment model
solution is used as the value of linCmt()
.
The compartments where you can dose in a linear solved system are
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css b/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css
new file mode 100644
index 000000000..6b4538284
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/css/crosstalk.min.css
@@ -0,0 +1 @@
+.container-fluid.crosstalk-bscols{margin-left:-30px;margin-right:-30px;white-space:normal}body>.container-fluid.crosstalk-bscols{margin-left:auto;margin-right:auto}.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:inline-block;padding-right:12px;vertical-align:top}@media only screen and (max-width: 480px){.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:block;padding-right:inherit}}.crosstalk-input{margin-bottom:15px}.crosstalk-input .control-label{margin-bottom:0;vertical-align:middle}.crosstalk-input input[type="checkbox"]{margin:4px 0 0;margin-top:1px;line-height:normal}.crosstalk-input .checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.crosstalk-input .checkbox>label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.crosstalk-input .checkbox input[type="checkbox"],.crosstalk-input .checkbox-inline input[type="checkbox"]{position:absolute;margin-top:2px;margin-left:-20px}.crosstalk-input .checkbox+.checkbox{margin-top:-5px}.crosstalk-input .checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.crosstalk-input .checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js
new file mode 100644
index 000000000..fd9eb53d2
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js
@@ -0,0 +1,1474 @@
+(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o b) {
+ return 1;
+ }
+}
+
+/**
+ * @private
+ */
+
+var FilterSet = function () {
+ function FilterSet() {
+ _classCallCheck(this, FilterSet);
+
+ this.reset();
+ }
+
+ _createClass(FilterSet, [{
+ key: "reset",
+ value: function reset() {
+ // Key: handle ID, Value: array of selected keys, or null
+ this._handles = {};
+ // Key: key string, Value: count of handles that include it
+ this._keys = {};
+ this._value = null;
+ this._activeHandles = 0;
+ }
+ }, {
+ key: "update",
+ value: function update(handleId, keys) {
+ if (keys !== null) {
+ keys = keys.slice(0); // clone before sorting
+ keys.sort(naturalComparator);
+ }
+
+ var _diffSortedLists = (0, _util.diffSortedLists)(this._handles[handleId], keys),
+ added = _diffSortedLists.added,
+ removed = _diffSortedLists.removed;
+
+ this._handles[handleId] = keys;
+
+ for (var i = 0; i < added.length; i++) {
+ this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;
+ }
+ for (var _i = 0; _i < removed.length; _i++) {
+ this._keys[removed[_i]]--;
+ }
+
+ this._updateValue(keys);
+ }
+
+ /**
+ * @param {string[]} keys Sorted array of strings that indicate
+ * a superset of possible keys.
+ * @private
+ */
+
+ }, {
+ key: "_updateValue",
+ value: function _updateValue() {
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._allKeys;
+
+ var handleCount = Object.keys(this._handles).length;
+ if (handleCount === 0) {
+ this._value = null;
+ } else {
+ this._value = [];
+ for (var i = 0; i < keys.length; i++) {
+ var count = this._keys[keys[i]];
+ if (count === handleCount) {
+ this._value.push(keys[i]);
+ }
+ }
+ }
+ }
+ }, {
+ key: "clear",
+ value: function clear(handleId) {
+ if (typeof this._handles[handleId] === "undefined") {
+ return;
+ }
+
+ var keys = this._handles[handleId];
+ if (!keys) {
+ keys = [];
+ }
+
+ for (var i = 0; i < keys.length; i++) {
+ this._keys[keys[i]]--;
+ }
+ delete this._handles[handleId];
+
+ this._updateValue();
+ }
+ }, {
+ key: "value",
+ get: function get() {
+ return this._value;
+ }
+ }, {
+ key: "_allKeys",
+ get: function get() {
+ var allKeys = Object.keys(this._keys);
+ allKeys.sort(naturalComparator);
+ return allKeys;
+ }
+ }]);
+
+ return FilterSet;
+}();
+
+exports.default = FilterSet;
+
+},{"./util":11}],4:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.default = group;
+
+var _var2 = require("./var");
+
+var _var3 = _interopRequireDefault(_var2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+// Use a global so that multiple copies of crosstalk.js can be loaded and still
+// have groups behave as singletons across all copies.
+global.__crosstalk_groups = global.__crosstalk_groups || {};
+var groups = global.__crosstalk_groups;
+
+function group(groupName) {
+ if (groupName && typeof groupName === "string") {
+ if (!groups.hasOwnProperty(groupName)) {
+ groups[groupName] = new Group(groupName);
+ }
+ return groups[groupName];
+ } else if ((typeof groupName === "undefined" ? "undefined" : _typeof(groupName)) === "object" && groupName._vars && groupName.var) {
+ // Appears to already be a group object
+ return groupName;
+ } else if (Array.isArray(groupName) && groupName.length == 1 && typeof groupName[0] === "string") {
+ return group(groupName[0]);
+ } else {
+ throw new Error("Invalid groupName argument");
+ }
+}
+
+var Group = function () {
+ function Group(name) {
+ _classCallCheck(this, Group);
+
+ this.name = name;
+ this._vars = {};
+ }
+
+ _createClass(Group, [{
+ key: "var",
+ value: function _var(name) {
+ if (!name || typeof name !== "string") {
+ throw new Error("Invalid var name");
+ }
+
+ if (!this._vars.hasOwnProperty(name)) this._vars[name] = new _var3.default(this, name);
+ return this._vars[name];
+ }
+ }, {
+ key: "has",
+ value: function has(name) {
+ if (!name || typeof name !== "string") {
+ throw new Error("Invalid var name");
+ }
+
+ return this._vars.hasOwnProperty(name);
+ }
+ }]);
+
+ return Group;
+}();
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./var":12}],5:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _group = require("./group");
+
+var _group2 = _interopRequireDefault(_group);
+
+var _selection = require("./selection");
+
+var _filter = require("./filter");
+
+var _input = require("./input");
+
+require("./input_selectize");
+
+require("./input_checkboxgroup");
+
+require("./input_slider");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var defaultGroup = (0, _group2.default)("default");
+
+function var_(name) {
+ return defaultGroup.var(name);
+}
+
+function has(name) {
+ return defaultGroup.has(name);
+}
+
+if (global.Shiny) {
+ global.Shiny.addCustomMessageHandler("update-client-value", function (message) {
+ if (typeof message.group === "string") {
+ (0, _group2.default)(message.group).var(message.name).set(message.value);
+ } else {
+ var_(message.name).set(message.value);
+ }
+ });
+}
+
+var crosstalk = {
+ group: _group2.default,
+ var: var_,
+ has: has,
+ SelectionHandle: _selection.SelectionHandle,
+ FilterHandle: _filter.FilterHandle,
+ bind: _input.bind
+};
+
+/**
+ * @namespace crosstalk
+ */
+exports.default = crosstalk;
+
+global.crosstalk = crosstalk;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./group":4,"./input":6,"./input_checkboxgroup":7,"./input_selectize":8,"./input_slider":9,"./selection":10}],6:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.register = register;
+exports.bind = bind;
+var $ = global.jQuery;
+
+var bindings = {};
+
+function register(reg) {
+ bindings[reg.className] = reg;
+ if (global.document && global.document.readyState !== "complete") {
+ $(function () {
+ bind();
+ });
+ } else if (global.document) {
+ setTimeout(bind, 100);
+ }
+}
+
+function bind() {
+ Object.keys(bindings).forEach(function (className) {
+ var binding = bindings[className];
+ $("." + binding.className).not(".crosstalk-input-bound").each(function (i, el) {
+ bindInstance(binding, el);
+ });
+ });
+}
+
+// Escape jQuery identifier
+function $escape(val) {
+ return val.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
+}
+
+function bindEl(el) {
+ var $el = $(el);
+ Object.keys(bindings).forEach(function (className) {
+ if ($el.hasClass(className) && !$el.hasClass("crosstalk-input-bound")) {
+ var binding = bindings[className];
+ bindInstance(binding, el);
+ }
+ });
+}
+
+function bindInstance(binding, el) {
+ var jsonEl = $(el).find("script[type='application/json'][data-for='" + $escape(el.id) + "']");
+ var data = JSON.parse(jsonEl[0].innerText);
+
+ var instance = binding.factory(el, data);
+ $(el).data("crosstalk-instance", instance);
+ $(el).addClass("crosstalk-input-bound");
+}
+
+if (global.Shiny) {
+ var inputBinding = new global.Shiny.InputBinding();
+ var _$ = global.jQuery;
+ _$.extend(inputBinding, {
+ find: function find(scope) {
+ return _$(scope).find(".crosstalk-input");
+ },
+ initialize: function initialize(el) {
+ if (!_$(el).hasClass("crosstalk-input-bound")) {
+ bindEl(el);
+ }
+ },
+ getId: function getId(el) {
+ return el.id;
+ },
+ getValue: function getValue(el) {},
+ setValue: function setValue(el, value) {},
+ receiveMessage: function receiveMessage(el, data) {},
+ subscribe: function subscribe(el, callback) {
+ _$(el).data("crosstalk-instance").resume();
+ },
+ unsubscribe: function unsubscribe(el) {
+ _$(el).data("crosstalk-instance").suspend();
+ }
+ });
+ global.Shiny.inputBindings.register(inputBinding, "crosstalk.inputBinding");
+}
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],7:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+
+input.register({
+ className: "crosstalk-input-checkboxgroup",
+
+ factory: function factory(el, data) {
+ /*
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var lastKnownKeys = void 0;
+ var $el = $(el);
+ $el.on("change", "input[type='checkbox']", function () {
+ var checked = $el.find("input[type='checkbox']:checked");
+ if (checked.length === 0) {
+ lastKnownKeys = null;
+ ctHandle.clear();
+ } else {
+ var keys = {};
+ checked.each(function () {
+ data.map[this.value].forEach(function (key) {
+ keys[key] = true;
+ });
+ });
+ var keyArray = Object.keys(keys);
+ keyArray.sort();
+ lastKnownKeys = keyArray;
+ ctHandle.set(keyArray);
+ }
+ });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6}],8:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _util = require("./util");
+
+var util = _interopRequireWildcard(_util);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+
+input.register({
+ className: "crosstalk-input-select",
+
+ factory: function factory(el, data) {
+ /*
+ * items: {value: [...], label: [...]}
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+
+ var first = [{ value: "", label: "(All)" }];
+ var items = util.dataframeToD3(data.items);
+ var opts = {
+ options: first.concat(items),
+ valueField: "value",
+ labelField: "label",
+ searchField: "label"
+ };
+
+ var select = $(el).find("select")[0];
+
+ var selectize = $(select).selectize(opts)[0].selectize;
+
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var lastKnownKeys = void 0;
+ selectize.on("change", function () {
+ if (selectize.items.length === 0) {
+ lastKnownKeys = null;
+ ctHandle.clear();
+ } else {
+ var keys = {};
+ selectize.items.forEach(function (group) {
+ data.map[group].forEach(function (key) {
+ keys[key] = true;
+ });
+ });
+ var keyArray = Object.keys(keys);
+ keyArray.sort();
+ lastKnownKeys = keyArray;
+ ctHandle.set(keyArray);
+ }
+ });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6,"./util":11}],9:[function(require,module,exports){
+(function (global){
+"use strict";
+
+var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+var _input = require("./input");
+
+var input = _interopRequireWildcard(_input);
+
+var _filter = require("./filter");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var $ = global.jQuery;
+var strftime = global.strftime;
+
+input.register({
+ className: "crosstalk-input-slider",
+
+ factory: function factory(el, data) {
+ /*
+ * map: {"groupA": ["keyA", "keyB", ...], ...}
+ * group: "ct-groupname"
+ */
+ var ctHandle = new _filter.FilterHandle(data.group);
+
+ var opts = {};
+ var $el = $(el).find("input");
+ var dataType = $el.data("data-type");
+ var timeFormat = $el.data("time-format");
+ var round = $el.data("round");
+ var timeFormatter = void 0;
+
+ // Set up formatting functions
+ if (dataType === "date") {
+ timeFormatter = strftime.utc();
+ opts.prettify = function (num) {
+ return timeFormatter(timeFormat, new Date(num));
+ };
+ } else if (dataType === "datetime") {
+ var timezone = $el.data("timezone");
+ if (timezone) timeFormatter = strftime.timezone(timezone);else timeFormatter = strftime;
+
+ opts.prettify = function (num) {
+ return timeFormatter(timeFormat, new Date(num));
+ };
+ } else if (dataType === "number") {
+ if (typeof round !== "undefined") opts.prettify = function (num) {
+ var factor = Math.pow(10, round);
+ return Math.round(num * factor) / factor;
+ };
+ }
+
+ $el.ionRangeSlider(opts);
+
+ function getValue() {
+ var result = $el.data("ionRangeSlider").result;
+
+ // Function for converting numeric value from slider to appropriate type.
+ var convert = void 0;
+ var dataType = $el.data("data-type");
+ if (dataType === "date") {
+ convert = function convert(val) {
+ return formatDateUTC(new Date(+val));
+ };
+ } else if (dataType === "datetime") {
+ convert = function convert(val) {
+ // Convert ms to s
+ return +val / 1000;
+ };
+ } else {
+ convert = function convert(val) {
+ return +val;
+ };
+ }
+
+ if ($el.data("ionRangeSlider").options.type === "double") {
+ return [convert(result.from), convert(result.to)];
+ } else {
+ return convert(result.from);
+ }
+ }
+
+ var lastKnownKeys = null;
+
+ $el.on("change.crosstalkSliderInput", function (event) {
+ if (!$el.data("updating") && !$el.data("animating")) {
+ var _getValue = getValue(),
+ _getValue2 = _slicedToArray(_getValue, 2),
+ from = _getValue2[0],
+ to = _getValue2[1];
+
+ var keys = [];
+ for (var i = 0; i < data.values.length; i++) {
+ var val = data.values[i];
+ if (val >= from && val <= to) {
+ keys.push(data.keys[i]);
+ }
+ }
+ keys.sort();
+ ctHandle.set(keys);
+ lastKnownKeys = keys;
+ }
+ });
+
+ // let $el = $(el);
+ // $el.on("change", "input[type="checkbox"]", function() {
+ // let checked = $el.find("input[type="checkbox"]:checked");
+ // if (checked.length === 0) {
+ // ctHandle.clear();
+ // } else {
+ // let keys = {};
+ // checked.each(function() {
+ // data.map[this.value].forEach(function(key) {
+ // keys[key] = true;
+ // });
+ // });
+ // let keyArray = Object.keys(keys);
+ // keyArray.sort();
+ // ctHandle.set(keyArray);
+ // }
+ // });
+
+ return {
+ suspend: function suspend() {
+ ctHandle.clear();
+ },
+ resume: function resume() {
+ if (lastKnownKeys) ctHandle.set(lastKnownKeys);
+ }
+ };
+ }
+});
+
+// Convert a number to a string with leading zeros
+function padZeros(n, digits) {
+ var str = n.toString();
+ while (str.length < digits) {
+ str = "0" + str;
+ }return str;
+}
+
+// Given a Date object, return a string in yyyy-mm-dd format, using the
+// UTC date. This may be a day off from the date in the local time zone.
+function formatDateUTC(date) {
+ if (date instanceof Date) {
+ return date.getUTCFullYear() + "-" + padZeros(date.getUTCMonth() + 1, 2) + "-" + padZeros(date.getUTCDate(), 2);
+ } else {
+ return null;
+ }
+}
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./filter":2,"./input":6}],10:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.SelectionHandle = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _events = require("./events");
+
+var _events2 = _interopRequireDefault(_events);
+
+var _group = require("./group");
+
+var _group2 = _interopRequireDefault(_group);
+
+var _util = require("./util");
+
+var util = _interopRequireWildcard(_util);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ * Use this class to read and write (and listen for changes to) the selection
+ * for a Crosstalk group. This is intended to be used for linked brushing.
+ *
+ * If two (or more) `SelectionHandle` instances in the same webpage share the
+ * same group name, they will share the same state. Setting the selection using
+ * one `SelectionHandle` instance will result in the `value` property instantly
+ * changing across the others, and `"change"` event listeners on all instances
+ * (including the one that initiated the sending) will fire.
+ *
+ * @param {string} [group] - The name of the Crosstalk group, or if none,
+ * null or undefined (or any other falsy value). This can be changed later
+ * via the [SelectionHandle#setGroup](#setGroup) method.
+ * @param {Object} [extraInfo] - An object whose properties will be copied to
+ * the event object whenever an event is emitted.
+ */
+var SelectionHandle = exports.SelectionHandle = function () {
+ function SelectionHandle() {
+ var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+ var extraInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+
+ _classCallCheck(this, SelectionHandle);
+
+ this._eventRelay = new _events2.default();
+ this._emitter = new util.SubscriptionTracker(this._eventRelay);
+
+ // Name of the group we're currently tracking, if any. Can change over time.
+ this._group = null;
+ // The Var we're currently tracking, if any. Can change over time.
+ this._var = null;
+ // The event handler subscription we currently have on var.on("change").
+ this._varOnChangeSub = null;
+
+ this._extraInfo = util.extend({ sender: this }, extraInfo);
+
+ this.setGroup(group);
+ }
+
+ /**
+ * Changes the Crosstalk group membership of this SelectionHandle. The group
+ * being switched away from (if any) will not have its selection value
+ * modified as a result of calling `setGroup`, even if this handle was the
+ * most recent handle to set the selection of the group.
+ *
+ * The group being switched to (if any) will also not have its selection value
+ * modified as a result of calling `setGroup`. If you want to set the
+ * selection value of the new group, call `set` explicitly.
+ *
+ * @param {string} group - The name of the Crosstalk group, or null (or
+ * undefined) to clear the group.
+ */
+
+
+ _createClass(SelectionHandle, [{
+ key: "setGroup",
+ value: function setGroup(group) {
+ var _this = this;
+
+ // If group is unchanged, do nothing
+ if (this._group === group) return;
+ // Treat null, undefined, and other falsy values the same
+ if (!this._group && !group) return;
+
+ if (this._var) {
+ this._var.off("change", this._varOnChangeSub);
+ this._var = null;
+ this._varOnChangeSub = null;
+ }
+
+ this._group = group;
+
+ if (group) {
+ this._var = (0, _group2.default)(group).var("selection");
+ var sub = this._var.on("change", function (e) {
+ _this._eventRelay.trigger("change", e, _this);
+ });
+ this._varOnChangeSub = sub;
+ }
+ }
+
+ /**
+ * Retrieves the current selection for the group represented by this
+ * `SelectionHandle`.
+ *
+ * - If no selection is active, then this value will be falsy.
+ * - If a selection is active, but no data points are selected, then this
+ * value will be an empty array.
+ * - If a selection is active, and data points are selected, then the keys
+ * of the selected data points will be present in the array.
+ */
+
+ }, {
+ key: "_mergeExtraInfo",
+
+
+ /**
+ * Combines the given `extraInfo` (if any) with the handle's default
+ * `_extraInfo` (if any).
+ * @private
+ */
+ value: function _mergeExtraInfo(extraInfo) {
+ // Important incidental effect: shallow clone is returned
+ return util.extend({}, this._extraInfo ? this._extraInfo : null, extraInfo ? extraInfo : null);
+ }
+
+ /**
+ * Overwrites the current selection for the group, and raises the `"change"`
+ * event among all of the group's '`SelectionHandle` instances (including
+ * this one).
+ *
+ * @fires SelectionHandle#change
+ * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see
+ * {@link SelectionHandle#value}).
+ * @param {Object} [extraInfo] - Extra properties to be included on the event
+ * object that's passed to listeners (in addition to any options that were
+ * passed into the `SelectionHandle` constructor).
+ */
+
+ }, {
+ key: "set",
+ value: function set(selectedKeys, extraInfo) {
+ if (this._var) this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));
+ }
+
+ /**
+ * Overwrites the current selection for the group, and raises the `"change"`
+ * event among all of the group's '`SelectionHandle` instances (including
+ * this one).
+ *
+ * @fires SelectionHandle#change
+ * @param {Object} [extraInfo] - Extra properties to be included on the event
+ * object that's passed to listeners (in addition to any that were passed
+ * into the `SelectionHandle` constructor).
+ */
+
+ }, {
+ key: "clear",
+ value: function clear(extraInfo) {
+ if (this._var) this.set(void 0, this._mergeExtraInfo(extraInfo));
+ }
+
+ /**
+ * Subscribes to events on this `SelectionHandle`.
+ *
+ * @param {string} eventType - Indicates the type of events to listen to.
+ * Currently, only `"change"` is supported.
+ * @param {SelectionHandle~listener} listener - The callback function that
+ * will be invoked when the event occurs.
+ * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel
+ * this subscription.
+ */
+
+ }, {
+ key: "on",
+ value: function on(eventType, listener) {
+ return this._emitter.on(eventType, listener);
+ }
+
+ /**
+ * Cancels event subscriptions created by {@link SelectionHandle#on}.
+ *
+ * @param {string} eventType - The type of event to unsubscribe.
+ * @param {string|SelectionHandle~listener} listener - Either the callback
+ * function previously passed into {@link SelectionHandle#on}, or the
+ * string that was returned from {@link SelectionHandle#on}.
+ */
+
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ return this._emitter.off(eventType, listener);
+ }
+
+ /**
+ * Shuts down the `SelectionHandle` object.
+ *
+ * Removes all event listeners that were added through this handle.
+ */
+
+ }, {
+ key: "close",
+ value: function close() {
+ this._emitter.removeAllListeners();
+ this.setGroup(null);
+ }
+ }, {
+ key: "value",
+ get: function get() {
+ return this._var ? this._var.get() : null;
+ }
+ }]);
+
+ return SelectionHandle;
+}();
+
+/**
+ * @callback SelectionHandle~listener
+ * @param {Object} event - An object containing details of the event. For
+ * `"change"` events, this includes the properties `value` (the new
+ * value of the selection, or `undefined` if no selection is active),
+ * `oldValue` (the previous value of the selection), and `sender` (the
+ * `SelectionHandle` instance that made the change).
+ */
+
+/**
+ * @event SelectionHandle#change
+ * @type {object}
+ * @property {object} value - The new value of the selection, or `undefined`
+ * if no selection is active.
+ * @property {object} oldValue - The previous value of the selection.
+ * @property {SelectionHandle} sender - The `SelectionHandle` instance that
+ * changed the value.
+ */
+
+},{"./events":1,"./group":4,"./util":11}],11:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.extend = extend;
+exports.checkSorted = checkSorted;
+exports.diffSortedLists = diffSortedLists;
+exports.dataframeToD3 = dataframeToD3;
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function extend(target) {
+ for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ sources[_key - 1] = arguments[_key];
+ }
+
+ for (var i = 0; i < sources.length; i++) {
+ var src = sources[i];
+ if (typeof src === "undefined" || src === null) continue;
+
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) {
+ target[key] = src[key];
+ }
+ }
+ }
+ return target;
+}
+
+function checkSorted(list) {
+ for (var i = 1; i < list.length; i++) {
+ if (list[i] <= list[i - 1]) {
+ throw new Error("List is not sorted or contains duplicate");
+ }
+ }
+}
+
+function diffSortedLists(a, b) {
+ var i_a = 0;
+ var i_b = 0;
+
+ if (!a) a = [];
+ if (!b) b = [];
+
+ var a_only = [];
+ var b_only = [];
+
+ checkSorted(a);
+ checkSorted(b);
+
+ while (i_a < a.length && i_b < b.length) {
+ if (a[i_a] === b[i_b]) {
+ i_a++;
+ i_b++;
+ } else if (a[i_a] < b[i_b]) {
+ a_only.push(a[i_a++]);
+ } else {
+ b_only.push(b[i_b++]);
+ }
+ }
+
+ if (i_a < a.length) a_only = a_only.concat(a.slice(i_a));
+ if (i_b < b.length) b_only = b_only.concat(b.slice(i_b));
+ return {
+ removed: a_only,
+ added: b_only
+ };
+}
+
+// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }
+// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]
+function dataframeToD3(df) {
+ var names = [];
+ var length = void 0;
+ for (var name in df) {
+ if (df.hasOwnProperty(name)) names.push(name);
+ if (_typeof(df[name]) !== "object" || typeof df[name].length === "undefined") {
+ throw new Error("All fields must be arrays");
+ } else if (typeof length !== "undefined" && length !== df[name].length) {
+ throw new Error("All fields must be arrays of the same length");
+ }
+ length = df[name].length;
+ }
+ var results = [];
+ var item = void 0;
+ for (var row = 0; row < length; row++) {
+ item = {};
+ for (var col = 0; col < names.length; col++) {
+ item[names[col]] = df[names[col]][row];
+ }
+ results.push(item);
+ }
+ return results;
+}
+
+/**
+ * Keeps track of all event listener additions/removals and lets all active
+ * listeners be removed with a single operation.
+ *
+ * @private
+ */
+
+var SubscriptionTracker = exports.SubscriptionTracker = function () {
+ function SubscriptionTracker(emitter) {
+ _classCallCheck(this, SubscriptionTracker);
+
+ this._emitter = emitter;
+ this._subs = {};
+ }
+
+ _createClass(SubscriptionTracker, [{
+ key: "on",
+ value: function on(eventType, listener) {
+ var sub = this._emitter.on(eventType, listener);
+ this._subs[sub] = eventType;
+ return sub;
+ }
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ var sub = this._emitter.off(eventType, listener);
+ if (sub) {
+ delete this._subs[sub];
+ }
+ return sub;
+ }
+ }, {
+ key: "removeAllListeners",
+ value: function removeAllListeners() {
+ var _this = this;
+
+ var current_subs = this._subs;
+ this._subs = {};
+ Object.keys(current_subs).forEach(function (sub) {
+ _this._emitter.off(current_subs[sub], sub);
+ });
+ }
+ }]);
+
+ return SubscriptionTracker;
+}();
+
+},{}],12:[function(require,module,exports){
+(function (global){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _events = require("./events");
+
+var _events2 = _interopRequireDefault(_events);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Var = function () {
+ function Var(group, name, /*optional*/value) {
+ _classCallCheck(this, Var);
+
+ this._group = group;
+ this._name = name;
+ this._value = value;
+ this._events = new _events2.default();
+ }
+
+ _createClass(Var, [{
+ key: "get",
+ value: function get() {
+ return this._value;
+ }
+ }, {
+ key: "set",
+ value: function set(value, /*optional*/event) {
+ if (this._value === value) {
+ // Do nothing; the value hasn't changed
+ return;
+ }
+ var oldValue = this._value;
+ this._value = value;
+ // Alert JavaScript listeners that the value has changed
+ var evt = {};
+ if (event && (typeof event === "undefined" ? "undefined" : _typeof(event)) === "object") {
+ for (var k in event) {
+ if (event.hasOwnProperty(k)) evt[k] = event[k];
+ }
+ }
+ evt.oldValue = oldValue;
+ evt.value = value;
+ this._events.trigger("change", evt, this);
+
+ // TODO: Make this extensible, to let arbitrary back-ends know that
+ // something has changed
+ if (global.Shiny && global.Shiny.onInputChange) {
+ global.Shiny.onInputChange(".clientValue-" + (this._group.name !== null ? this._group.name + "-" : "") + this._name, typeof value === "undefined" ? null : value);
+ }
+ }
+ }, {
+ key: "on",
+ value: function on(eventType, listener) {
+ return this._events.on(eventType, listener);
+ }
+ }, {
+ key: "off",
+ value: function off(eventType, listener) {
+ return this._events.off(eventType, listener);
+ }
+ }]);
+
+ return Var;
+}();
+
+exports.default = Var;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"./events":1}]},{},[5])
+//# sourceMappingURL=crosstalk.js.map
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map
new file mode 100644
index 000000000..cff94f089
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.js.map
@@ -0,0 +1,37 @@
+{
+ "version": 3,
+ "sources": [
+ "node_modules/browser-pack/_prelude.js",
+ "javascript/src/events.js",
+ "javascript/src/filter.js",
+ "javascript/src/filterset.js",
+ "javascript/src/group.js",
+ "javascript/src/index.js",
+ "javascript/src/input.js",
+ "javascript/src/input_checkboxgroup.js",
+ "javascript/src/input_selectize.js",
+ "javascript/src/input_slider.js",
+ "javascript/src/selection.js",
+ "javascript/src/util.js",
+ "javascript/src/var.js"
+ ],
+ "names": [],
+ "mappings": "AAAA;;;;;;;;;;;ICAqB,M;AACnB,oBAAc;AAAA;;AACZ,SAAK,MAAL,GAAc,EAAd;AACA,SAAK,IAAL,GAAY,CAAZ;AACD;;;;uBAEE,S,EAAW,Q,EAAU;AACtB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,CAAC,IAAL,EAAW;AACT,eAAO,KAAK,MAAL,CAAY,SAAZ,IAAyB,EAAhC;AACD;AACD,UAAI,MAAM,QAAS,KAAK,IAAL,EAAnB;AACA,WAAK,GAAL,IAAY,QAAZ;AACA,aAAO,GAAP;AACD;;AAED;;;;wBACI,S,EAAW,Q,EAAU;AACvB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,OAAO,QAAP,KAAqB,UAAzB,EAAqC;AACnC,aAAK,IAAI,GAAT,IAAgB,IAAhB,EAAsB;AACpB,cAAI,KAAK,cAAL,CAAoB,GAApB,CAAJ,EAA8B;AAC5B,gBAAI,KAAK,GAAL,MAAc,QAAlB,EAA4B;AAC1B,qBAAO,KAAK,GAAL,CAAP;AACA,qBAAO,GAAP;AACD;AACF;AACF;AACD,eAAO,KAAP;AACD,OAVD,MAUO,IAAI,OAAO,QAAP,KAAqB,QAAzB,EAAmC;AACxC,YAAI,QAAQ,KAAK,QAAL,CAAZ,EAA4B;AAC1B,iBAAO,KAAK,QAAL,CAAP;AACA,iBAAO,QAAP;AACD;AACD,eAAO,KAAP;AACD,OANM,MAMA;AACL,cAAM,IAAI,KAAJ,CAAU,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W,Q,EAAU;AACvB,aAAO,KAAK,OAAL,CAAa,GAAb,CAAiB,SAAjB,EAA4B,QAA5B,CAAP;AACD;;;;;;kBAjDkB,G",
+ "file": "generated.js",
+ "sourceRoot": "",
+ "sourcesContent": [
+ "(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n",
+ "import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n",
+ "import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n",
+ "import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n",
+ "let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n",
+ "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
+ "import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
+ "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n",
+ "import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n",
+ "export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n",
+ "import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js
new file mode 100644
index 000000000..b7ec0ac9f
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/js/crosstalk.min.js
@@ -0,0 +1,2 @@
+!function o(u,a,l){function s(n,e){if(!a[n]){if(!u[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[n]={exports:{}};u[n][0].call(i.exports,function(e){var t=u[n][1][e];return s(t||e)},i,i.exports,o,u,a,l)}return a[n].exports}for(var f="function"==typeof require&&require,e=0;e?@[\\\]^`{|}~])/g,"\\$1")+"']"),r=JSON.parse(n[0].innerText),i=e.factory(t,r);o(t).data("crosstalk-instance",i),o(t).addClass("crosstalk-input-bound")}if(t.Shiny){var e=new t.Shiny.InputBinding,u=t.jQuery;u.extend(e,{find:function(e){return u(e).find(".crosstalk-input")},initialize:function(e){var t,n;u(e).hasClass("crosstalk-input-bound")||(n=o(t=e),Object.keys(r).forEach(function(e){n.hasClass(e)&&!n.hasClass("crosstalk-input-bound")&&i(r[e],t)}))},getId:function(e){return e.id},getValue:function(e){},setValue:function(e,t){},receiveMessage:function(e,t){},subscribe:function(e,t){u(e).data("crosstalk-instance").resume()},unsubscribe:function(e){u(e).data("crosstalk-instance").suspend()}}),t.Shiny.inputBindings.register(e,"crosstalk.inputBinding")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(r,e,t){(function(e){"use strict";var t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(r("./input")),n=r("./filter");var a=e.jQuery;t.register({className:"crosstalk-input-checkboxgroup",factory:function(e,r){var i=new n.FilterHandle(r.group),o=void 0,u=a(e);return u.on("change","input[type='checkbox']",function(){var e=u.find("input[type='checkbox']:checked");if(0===e.length)o=null,i.clear();else{var t={};e.each(function(){r.map[this.value].forEach(function(e){t[e]=!0})});var n=Object.keys(t);n.sort(),o=n,i.set(n)}}),{suspend:function(){i.clear()},resume:function(){o&&i.set(o)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6}],8:[function(r,e,t){(function(e){"use strict";var t=n(r("./input")),l=n(r("./util")),s=r("./filter");function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var f=e.jQuery;t.register({className:"crosstalk-input-select",factory:function(e,n){var t=l.dataframeToD3(n.items),r={options:[{value:"",label:"(All)"}].concat(t),valueField:"value",labelField:"label",searchField:"label"},i=f(e).find("select")[0],o=f(i).selectize(r)[0].selectize,u=new s.FilterHandle(n.group),a=void 0;return o.on("change",function(){if(0===o.items.length)a=null,u.clear();else{var t={};o.items.forEach(function(e){n.map[e].forEach(function(e){t[e]=!0})});var e=Object.keys(t);e.sort(),a=e,u.set(e)}}),{suspend:function(){u.clear()},resume:function(){a&&u.set(a)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6,"./util":11}],9:[function(n,e,t){(function(e){"use strict";var d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./input")),a=n("./filter");var v=e.jQuery,p=e.strftime;function y(e,t){for(var n=e.toString();n.length {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n","import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n","import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n","import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n","let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n","import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n","export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n","import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"]}
\ No newline at end of file
diff --git a/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss b/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss
new file mode 100644
index 000000000..35665616f
--- /dev/null
+++ b/articles/rxode2-model-types_files/crosstalk-1.2.1/scss/crosstalk.scss
@@ -0,0 +1,75 @@
+/* Adjust margins outwards, so column contents line up with the edges of the
+ parent of container-fluid. */
+.container-fluid.crosstalk-bscols {
+ margin-left: -30px;
+ margin-right: -30px;
+ white-space: normal;
+}
+
+/* But don't adjust the margins outwards if we're directly under the body,
+ i.e. we were the top-level of something at the console. */
+body > .container-fluid.crosstalk-bscols {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
+ display: inline-block;
+ padding-right: 12px;
+ vertical-align: top;
+}
+
+@media only screen and (max-width:480px) {
+ .crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
+ display: block;
+ padding-right: inherit;
+ }
+}
+
+/* Relevant BS3 styles to make filter_checkbox() look reasonable without Bootstrap */
+.crosstalk-input {
+ margin-bottom: 15px; /* a la .form-group */
+ .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ input[type="checkbox"] {
+ margin: 4px 0 0;
+ margin-top: 1px;
+ line-height: normal;
+ }
+ .checkbox {
+ position: relative;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+ .checkbox > label{
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ cursor: pointer;
+ }
+ .checkbox input[type="checkbox"],
+ .checkbox-inline input[type="checkbox"] {
+ position: absolute;
+ margin-top: 2px;
+ margin-left: -20px;
+ }
+ .checkbox + .checkbox {
+ margin-top: -5px;
+ }
+ .checkbox-inline {
+ position: relative;
+ display: inline-block;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ vertical-align: middle;
+ cursor: pointer;
+ }
+ .checkbox-inline + .checkbox-inline {
+ margin-top: 0;
+ margin-left: 10px;
+ }
+}
diff --git a/articles/rxode2-nesting.html b/articles/rxode2-nesting.html
index 6c677d836..2533aa763 100644
--- a/articles/rxode2-nesting.html
+++ b/articles/rxode2-nesting.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Nesting levels in rxode2
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-nesting.Rmd
rxode2-nesting.Rmd
@@ -312,24 +312,24 @@ Uncertainty in Model parametersdimnames(tMat) <- list(names(theta), names(theta))
tMat
-#> TKA TCl V2 Q V3 Kin
-#> TKA 0.10062025 -0.12295469 -0.04531495 -0.02397077 -0.02434600 -0.04904029
-#> TCl -0.12295469 0.25162132 -0.01212188 0.02716814 0.06137190 0.05300572
-#> V2 -0.04531495 -0.01212188 0.23379983 -0.02496544 -0.04012738 0.07997442
-#> Q -0.02397077 0.02716814 -0.02496544 0.02821405 0.02076256 -0.04388260
-#> V3 -0.02434600 0.06137190 -0.04012738 0.02076256 0.16198186 -0.11895883
-#> Kin -0.04904029 0.05300572 0.07997442 -0.04388260 -0.11895883 0.26339638
-#> Kout -0.03343029 -0.02601856 0.08114984 0.02523323 -0.01569376 -0.03609746
-#> EC50 -0.12588070 0.14843107 -0.03577880 0.05992831 0.07451059 -0.02226063
-#> Kout EC50
-#> TKA -0.03343029 -0.12588070
-#> TCl -0.02601856 0.14843107
-#> V2 0.08114984 -0.03577880
-#> Q 0.02523323 0.05992831
-#> V3 -0.01569376 0.07451059
-#> Kin -0.03609746 -0.02226063
-#> Kout 0.09716982 0.03006571
-#> EC50 0.03006571 0.31726414
+#> TKA TCl V2 Q V3
+#> TKA 0.11619015 0.073703715 0.04369253 -0.016660366 -0.011193396
+#> TCl 0.07370372 0.113971693 0.06841157 -0.015578152 -0.055073884
+#> V2 0.04369253 0.068411574 0.22142001 -0.074616276 -0.019774853
+#> Q -0.01666037 -0.015578152 -0.07461628 0.075884128 0.020726895
+#> V3 -0.01119340 -0.055073884 -0.01977485 0.020726895 0.075776432
+#> Kin 0.01846965 -0.033098860 0.04143756 -0.008003217 0.020555705
+#> Kout -0.02395367 -0.010482608 -0.02421182 -0.010248683 -0.007926701
+#> EC50 -0.01338289 -0.006578812 -0.05736582 0.089005982 0.030902333
+#> Kin Kout EC50
+#> TKA 0.018469652 -0.023953675 -0.013382894
+#> TCl -0.033098860 -0.010482608 -0.006578812
+#> V2 0.041437564 -0.024211825 -0.057365823
+#> Q -0.008003217 -0.010248683 0.089005982
+#> V3 0.020555705 -0.007926701 0.030902333
+#> Kin 0.083079307 -0.012669148 -0.015209539
+#> Kout -0.012669148 0.109646723 -0.028508758
+#> EC50 -0.015209539 -0.028508758 0.117687226
Nesting Variability
@@ -397,8 +397,6 @@ Solving the problem=400)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
#> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout
-#> @(lsoda.c:750
-#> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout
#> @(lsoda.c:750
#> Warning: some ID(s) could not solve the ODEs correctly; These values are
#> replaced with 'NA'
@@ -409,16 +407,16 @@ Solving the problem#> # A tibble: 8,000 x 24
#> sim.id id `inv.Cl(inv==1)` `inv.Cl(inv==2)` `inv.Ka(inv==1)`
#> <int> <fct> <dbl> <dbl> <dbl>
-#> 1 1 1 -0.0390 -0.0402 -0.0942
-#> 2 1 2 -0.0390 -0.0402 -0.0942
-#> 3 1 3 -0.0390 -0.0402 -0.0942
-#> 4 1 4 -0.0390 -0.0402 -0.0942
-#> 5 1 5 -0.0390 -0.0402 -0.0942
-#> 6 1 6 -0.0390 -0.0402 -0.0942
-#> 7 1 7 -0.0390 -0.0402 -0.0942
-#> 8 1 8 -0.0390 -0.0402 -0.0942
-#> 9 1 9 -0.0390 -0.0402 -0.0942
-#> 10 1 10 -0.0390 -0.0402 -0.0942
+#> 1 1 1 0.108 0.363 -0.110
+#> 2 1 2 0.108 0.363 -0.110
+#> 3 1 3 0.108 0.363 -0.110
+#> 4 1 4 0.108 0.363 -0.110
+#> 5 1 5 0.108 0.363 -0.110
+#> 6 1 6 0.108 0.363 -0.110
+#> 7 1 7 0.108 0.363 -0.110
+#> 8 1 8 0.108 0.363 -0.110
+#> 9 1 9 0.108 0.363 -0.110
+#> 10 1 10 0.108 0.363 -0.110
#> # i 7,990 more rows
#> # i 19 more variables: `inv.Ka(inv==2)` <dbl>, `eye.Cl(eye==1)` <dbl>,
#> # `eye.Cl(eye==2)` <dbl>, `eye.Ka(eye==1)` <dbl>, `eye.Ka(eye==2)` <dbl>,
@@ -435,17 +433,17 @@ Solving the problem#>
#> -- First part of data (object): --
#> # A tibble: 976,000 x 21
-#> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2 C3
-#> <int> <int> [h] <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 1 0 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 0 0
-#> 2 1 1 0.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 1.24 0.00724
-#> 3 1 1 4 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 16.5 5.02
-#> 4 1 1 4.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 32.3 5.15
-#> 5 1 1 8 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 21.8 8.35
-#> 6 1 1 8.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 12.6 8.40
+#> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2
+#> <int> <int> [h] <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 1 0 0.108 -0.110 0.432 0.586 -0.0881 0.0304 0
+#> 2 1 1 0.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -18.9
+#> 3 1 1 4 0.108 -0.110 0.432 0.586 -0.0881 0.0304 -847.
+#> 4 1 1 4.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -715.
+#> 5 1 1 8 0.108 -0.110 0.432 0.586 -0.0881 0.0304 -3785.
+#> 6 1 1 8.1 0.108 -0.110 -0.0583 0.175 -0.0881 0.0304 -4970.
#> # i 975,994 more rows
-#> # i 10 more variables: CL <dbl>, KA <dbl>, ef0 <dbl>, depot <dbl>, centr <dbl>,
-#> # peri <dbl>, eff <dbl>, occ <fct>, eye <fct>, inv <fct>
+#> # i 11 more variables: C3 <dbl>, CL <dbl>, KA <dbl>, ef0 <dbl>, depot <dbl>,
+#> # centr <dbl>, peri <dbl>, eff <dbl>, occ <fct>, eye <fct>, inv <fct>
There are multiple investigators in a study; Each investigator has a
number of individuals enrolled at their site. rxode2
automatically determines the number of investigators and then will
@@ -464,63 +462,63 @@
Solving the problem
print(head(s$params))
#> sim.id id inv.Cl(inv==1) inv.Cl(inv==2) inv.Ka(inv==1) inv.Ka(inv==2)
-#> 1 1 1 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 2 1 2 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 3 1 3 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 4 1 4 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 5 1 5 -0.03903519 -0.0402308 -0.09422733 -0.2222389
-#> 6 1 6 -0.03903519 -0.0402308 -0.09422733 -0.2222389
+#> 1 1 1 0.1082821 0.3626882 -0.109708 0.09798624
+#> 2 1 2 0.1082821 0.3626882 -0.109708 0.09798624
+#> 3 1 3 0.1082821 0.3626882 -0.109708 0.09798624
+#> 4 1 4 0.1082821 0.3626882 -0.109708 0.09798624
+#> 5 1 5 0.1082821 0.3626882 -0.109708 0.09798624
+#> 6 1 6 0.1082821 0.3626882 -0.109708 0.09798624
#> eye.Cl(eye==1) eye.Cl(eye==2) eye.Ka(eye==1) eye.Ka(eye==2) iov.Cl(occ==1)
-#> 1 0.29091811 -0.01542317 0.07258091 0.34505211 0.01684535
-#> 2 -0.14901624 -0.38252332 0.03616125 -0.02581829 -0.01951429
-#> 3 0.04366161 0.04893422 0.34442986 0.05949640 0.02975505
-#> 4 0.53381517 -0.23612630 0.02020768 0.13279331 -0.14357799
-#> 5 0.10876531 -0.01837668 -0.07839463 0.66759002 -0.11951379
-#> 6 0.29345370 -0.16347273 0.16696714 -0.21050912 0.13931739
-#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
-#> 1 0.0676210373 0.02665256 -0.05464559 40.19573 297.5459 19.14549
-#> 2 -0.0001926847 0.08155886 -0.10087830 40.19573 297.5459 19.14549
-#> 3 0.0807252964 0.06784367 0.20606147 40.19573 297.5459 19.14549
-#> 4 0.1841479804 0.02825059 -0.03639285 40.19573 297.5459 19.14549
-#> 5 0.0481570368 -0.16042582 -0.03872286 40.19573 297.5459 19.14549
-#> 6 -0.0201587971 -0.03760217 -0.11540276 40.19573 297.5459 19.14549
-#> eta.Cl TKA eta.Ka Q Kin Kout EC50
-#> 1 -0.01012319 0.1951491 -0.12653552 10.49742 0.7229821 0.749676 200.0693
-#> 2 -0.61749725 0.1951491 0.13550157 10.49742 0.7229821 0.749676 200.0693
-#> 3 0.28943517 0.1951491 0.08638813 10.49742 0.7229821 0.749676 200.0693
-#> 4 -0.32822614 0.1951491 -0.39633056 10.49742 0.7229821 0.749676 200.0693
-#> 5 -0.06070510 0.1951491 -0.47385633 10.49742 0.7229821 0.749676 200.0693
-#> 6 0.32947559 0.1951491 -0.12152307 10.49742 0.7229821 0.749676 200.0693
+#> 1 0.43197371 -0.058328678 0.586264966 0.174884342 -0.08811714
+#> 2 0.08559430 0.006108123 -0.005624186 -0.020710794 0.10637721
+#> 3 0.02708297 -0.001796112 0.240805194 0.009550938 0.06595025
+#> 4 0.09386198 -0.239239291 -0.079574652 0.004080677 0.23965275
+#> 5 -0.03540689 -0.032725874 0.209994611 -0.246674424 0.02757919
+#> 6 0.44890673 -0.325267423 -0.024517791 -0.050395249 -0.14357516
+#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
+#> 1 0.07218375 0.03039623 0.067693210 39.90301 297.153 18.10281
+#> 2 0.02406445 0.03465175 0.169113740 39.90301 297.153 18.10281
+#> 3 0.07833762 0.16896481 0.083329437 39.90301 297.153 18.10281
+#> 4 0.09014535 0.16781970 -0.007580041 39.90301 297.153 18.10281
+#> 5 -0.02744128 -0.05331629 0.123470046 39.90301 297.153 18.10281
+#> 6 0.14006037 0.16503842 -0.069874068 39.90301 297.153 18.10281
+#> eta.Cl TKA eta.Ka Q Kin Kout EC50
+#> 1 0.3276499 -0.3669389 0.1976122 10.56335 0.9466661 1.471005 199.9767
+#> 2 -0.1956677 -0.3669389 -0.4448090 10.56335 0.9466661 1.471005 199.9767
+#> 3 -0.7690862 -0.3669389 0.4423792 10.56335 0.9466661 1.471005 199.9767
+#> 4 -0.2558634 -0.3669389 -0.2013753 10.56335 0.9466661 1.471005 199.9767
+#> 5 -0.6370408 -0.3669389 -0.2217999 10.56335 0.9466661 1.471005 199.9767
+#> 6 -0.2844281 -0.3669389 0.2746496 10.56335 0.9466661 1.471005 199.9767
#> sim.id id inv.Cl(inv==1) inv.Cl(inv==2) inv.Ka(inv==1) inv.Ka(inv==2)
-#> 1 2 1 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 2 2 2 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 3 2 3 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 4 2 4 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 5 2 5 -0.04491481 -0.09395214 0.08965191 0.1265575
-#> 6 2 6 -0.04491481 -0.09395214 0.08965191 0.1265575
+#> 1 2 1 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 2 2 2 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 3 2 3 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 4 2 4 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 5 2 5 -0.2185114 0.1578254 -0.06550178 0.01692558
+#> 6 2 6 -0.2185114 0.1578254 -0.06550178 0.01692558
#> eye.Cl(eye==1) eye.Cl(eye==2) eye.Ka(eye==1) eye.Ka(eye==2) iov.Cl(occ==1)
-#> 1 -0.32697281 0.05799824 0.05028534 0.302033419 -0.10995295
-#> 2 -0.02159235 0.06495060 0.28662841 0.061231871 -0.03617266
-#> 3 -0.30216008 0.17484210 -0.03947689 -0.050076485 -0.07469975
-#> 4 0.15415822 -0.12064344 -0.29445326 -0.185026088 -0.11227958
-#> 5 0.09671987 -0.08665433 -0.07282272 -0.241574148 -0.17869466
-#> 6 0.05892414 -0.15623698 -0.08837725 0.006157003 0.15371362
-#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
-#> 1 -0.112893048 0.098532914 0.05867914 41.14554 297.2317 19.29969
-#> 2 -0.003219473 -0.258834701 -0.07328102 41.14554 297.2317 19.29969
-#> 3 -0.163476114 -0.141774495 -0.03129942 41.14554 297.2317 19.29969
-#> 4 0.145940005 -0.008140622 -0.07572177 41.14554 297.2317 19.29969
-#> 5 -0.098236212 0.064253865 -0.03018284 41.14554 297.2317 19.29969
-#> 6 0.065147255 -0.078717810 0.05578569 41.14554 297.2317 19.29969
-#> eta.Cl TKA eta.Ka Q Kin Kout EC50
-#> 1 0.1955688 -0.145662 -0.37850798 10.31685 1.759972 1.026146 199.8189
-#> 2 0.5163013 -0.145662 0.01158123 10.31685 1.759972 1.026146 199.8189
-#> 3 -0.2067334 -0.145662 -0.38842622 10.31685 1.759972 1.026146 199.8189
-#> 4 0.1474554 -0.145662 -0.17572677 10.31685 1.759972 1.026146 199.8189
-#> 5 -0.4601038 -0.145662 -0.43805881 10.31685 1.759972 1.026146 199.8189
-#> 6 0.4399962 -0.145662 0.12118850 10.31685 1.759972 1.026146 199.8189
+#> 1 -0.28983275 0.23313282 0.054875269 -0.10816332 0.03378266
+#> 2 0.17133543 -0.09585557 -0.018382439 0.03009169 -0.03036841
+#> 3 -0.04487519 -0.10519202 0.300869327 0.13375274 0.05674318
+#> 4 0.19924316 0.02586329 -0.109179227 0.22221001 0.06869933
+#> 5 -0.05895218 -0.28987217 -0.007452707 -0.03639888 -0.03700882
+#> 6 0.18030544 -0.37938212 0.270230738 -0.15310814 -0.15591525
+#> iov.Cl(occ==2) iov.Ka(occ==1) iov.Ka(occ==2) V2 V3 TCl
+#> 1 0.05942611 0.02503154 -0.11716174 39.484 297.4703 18.23602
+#> 2 0.07854405 0.12953177 0.08902964 39.484 297.4703 18.23602
+#> 3 -0.05471371 0.04489170 -0.01115435 39.484 297.4703 18.23602
+#> 4 0.01822086 0.29324185 0.09084004 39.484 297.4703 18.23602
+#> 5 -0.16679912 0.03565972 0.05666132 39.484 297.4703 18.23602
+#> 6 0.11982797 0.11883012 -0.01873016 39.484 297.4703 18.23602
+#> eta.Cl TKA eta.Ka Q Kin Kout EC50
+#> 1 -0.2606673 0.4157218 -0.113167108 10.59193 0.7312587 1.12052 200.1582
+#> 2 0.4088169 0.4157218 0.494133531 10.59193 0.7312587 1.12052 200.1582
+#> 3 -0.2175045 0.4157218 -0.002530923 10.59193 0.7312587 1.12052 200.1582
+#> 4 0.5150686 0.4157218 -0.121588025 10.59193 0.7312587 1.12052 200.1582
+#> 5 0.3760662 0.4157218 0.218664584 10.59193 0.7312587 1.12052 200.1582
+#> 6 0.3092382 0.4157218 0.065845127 10.59193 0.7312587 1.12052 200.1582
For between eye variability and between occasion variability each
individual simulates a number of variables that become the between eye
and between occasion variability; In the case of the eye:
diff --git a/articles/rxode2-pipeline.html b/articles/rxode2-pipeline.html
index aab3ee0a0..e5676442f 100644
--- a/articles/rxode2-pipeline.html
+++ b/articles/rxode2-pipeline.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 in a pipeline
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-pipeline.Rmd
rxode2-pipeline.Rmd
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png
index d20d9935e..74812e697 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png
index 9f221e139..1b13ea7f4 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-12-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png
index 16f19118f..15a78c504 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png
index 7619970c3..296567987 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-14-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png
index e5c6b755b..f61055b46 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png
index f794c6432..b938009fb 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png
index 5c179b1a3..40b0f3fbc 100644
Binary files a/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-pipeline_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-plot.html b/articles/rxode2-plot.html
index 01225ff7e..e06602924 100644
--- a/articles/rxode2-plot.html
+++ b/articles/rxode2-plot.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-plot.Rmd
rxode2-plot.Rmd
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png
index 0a6560d2d..aa962183e 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png
index 76266c0ae..5b830abc3 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-2-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png
index 0efe09130..56735d09b 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png
index cb9f763d1..ce62c6d38 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png
index 7f18b4fbd..6436e5c7e 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png
index cad1f1933..7384b4f91 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png b/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png
index 26b265d95..3a5ab4007 100644
Binary files a/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png and b/articles/rxode2-plot_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/articles/rxode2-prior-data.html b/articles/rxode2-prior-data.html
index 41a2496ff..79aa0815f 100644
--- a/articles/rxode2-prior-data.html
+++ b/articles/rxode2-prior-data.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Using Prior Data for ODE solving
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-prior-data.Rmd
rxode2-prior-data.Rmd
@@ -242,33 +242,33 @@ Using prior data for solving#> ── Solved rxode2 object ──
#> ── Parameters ($params): ──
#> # A tibble: 12 × 7
-#> id tka tcl tv eta.ka eta.cl eta.v
-#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0.451 1.02 3.45 0.0844 -0.366 -0.129
-#> 2 2 0.451 1.02 3.45 0.286 -0.223 -0.00544
-#> 3 3 0.451 1.02 3.45 1.38 -0.258 -0.0442
-#> 4 4 0.451 1.02 3.45 0.745 -0.228 0.162
-#> 5 5 0.451 1.02 3.45 0.384 -0.000858 0.0493
-#> 6 6 0.451 1.02 3.45 -2.45 0.442 0.305
-#> 7 7 0.451 1.02 3.45 0.524 -0.784 0.0160
-#> 8 8 0.451 1.02 3.45 0.0609 -0.117 -0.233
-#> 9 9 0.451 1.02 3.45 -0.750 -0.370 -0.457
-#> 10 10 0.451 1.02 3.45 0.0168 0.101 0.0964
-#> 11 11 0.451 1.02 3.45 0.248 -0.233 0.112
-#> 12 12 0.451 1.02 3.45 0.157 0.127 -0.591
+#> id tka tcl tv eta.ka eta.cl eta.v
+#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 0.451 1.02 3.45 -0.431 0.185 0.143
+#> 2 2 0.451 1.02 3.45 0.0585 -0.518 -0.127
+#> 3 3 0.451 1.02 3.45 0.710 -0.180 -0.130
+#> 4 4 0.451 1.02 3.45 1.16 0.0582 0.230
+#> 5 5 0.451 1.02 3.45 0.406 0.227 -0.0981
+#> 6 6 0.451 1.02 3.45 0.0960 0.0544 -0.658
+#> 7 7 0.451 1.02 3.45 -0.0790 0.519 0.0537
+#> 8 8 0.451 1.02 3.45 -1.70 -0.670 -0.118
+#> 9 9 0.451 1.02 3.45 -0.582 -0.546 -0.305
+#> 10 10 0.451 1.02 3.45 -0.275 -0.303 -0.298
+#> 11 11 0.451 1.02 3.45 0.564 -0.245 0.00526
+#> 12 12 0.451 1.02 3.45 0.126 0.353 0.211
#> ── Initial Conditions ($inits): ──
#> depot center
#> 0 0
#> ── First part of data (object): ──
#> # A tibble: 132 × 8
-#> id time ka cl v cp depot center
-#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0 1.71 1.92 27.7 0 320. 0
-#> 2 1 0.25 1.71 1.92 27.7 3.98 209. 110.
-#> 3 1 0.57 1.71 1.92 27.7 7.04 121. 195.
-#> 4 1 1.12 1.71 1.92 27.7 9.38 47.2 259.
-#> 5 1 2.02 1.71 1.92 27.7 10.1 10.2 279.
-#> 6 1 3.82 1.71 1.92 27.7 9.24 0.469 255.
+#> id time ka cl v cp depot center
+#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 1 0 1.02 3.33 36.3 0 320. 0
+#> 2 1 0.25 1.02 3.33 36.3 1.96 248. 71.2
+#> 3 1 0.57 1.02 3.33 36.3 3.78 179. 137.
+#> 4 1 1.12 1.02 3.33 36.3 5.65 102. 205.
+#> 5 1 2.02 1.02 3.33 36.3 6.81 40.8 247.
+#> 6 1 3.82 1.02 3.33 36.3 6.63 6.50 241.
#> # ℹ 126 more rows
## Of course the fasest way to solve if you don't care about the rxode2 extra parameters is
@@ -282,31 +282,31 @@ Using prior data for solving#> # A tibble: 132 × 8
#> id time ka cl v cp depot center
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 1 0 1.90 3.99 45.5 0 3.20e+2 0
-#> 2 1 0.25 1.90 3.99 45.5 2.62 1.99e+2 119.
-#> 3 1 0.57 1.90 3.99 45.5 4.51 1.09e+2 205.
-#> 4 1 1.12 1.90 3.99 45.5 5.80 3.83e+1 264.
-#> 5 1 2.02 1.90 3.99 45.5 6.02 6.96e+0 274.
-#> 6 1 3.82 1.90 3.99 45.5 5.27 2.30e-1 240.
-#> 7 1 5.1 1.90 3.99 45.5 4.72 2.03e-2 215.
-#> 8 1 7.03 1.90 3.99 45.5 3.98 5.24e-4 181.
-#> 9 1 9.05 1.90 3.99 45.5 3.34 1.14e-5 152.
-#> 10 1 12.1 1.90 3.99 45.5 2.55 3.37e-8 116.
+#> 1 1 0 2.30 1.43 38.7 0 3.20e+2 0
+#> 2 1 0.25 2.30 1.43 38.7 3.60 1.80e+2 139.
+#> 3 1 0.57 2.30 1.43 38.7 5.96 8.62e+1 231.
+#> 4 1 1.12 2.30 1.43 38.7 7.42 2.43e+1 287.
+#> 5 1 2.02 2.30 1.43 38.7 7.72 3.07e+0 299.
+#> 6 1 3.82 2.30 1.43 38.7 7.30 4.87e-2 282.
+#> 7 1 5.1 2.30 1.43 38.7 6.96 2.56e-3 269.
+#> 8 1 7.03 2.30 1.43 38.7 6.48 3.02e-5 251.
+#> 9 1 9.05 2.30 1.43 38.7 6.02 2.89e-7 233.
+#> 10 1 12.1 2.30 1.43 38.7 5.37 1.54e-9 208.
#> # ℹ 122 more rows
data.table::data.table(solveData)
-#> id time ka cl v cp depot center
-#> 1: 1 0.00 1.895099 3.987523 45.47526 0.0000000 3.199920e+02 0.00000
-#> 2: 1 0.25 1.895099 3.987523 45.47526 2.6241287 1.992422e+02 119.33294
-#> 3: 1 0.57 1.895099 3.987523 45.47526 4.5132815 1.086455e+02 205.24265
-#> 4: 1 1.12 1.895099 3.987523 45.47526 5.8044894 3.831280e+01 263.96067
-#> 5: 1 2.02 1.895099 3.987523 45.47526 6.0198854 6.960095e+00 273.75586
-#> ---
-#> 128: 12 5.07 4.299781 2.744429 25.14956 7.5229329 1.098088e-07 189.19843
-#> 129: 12 7.07 4.299781 2.744429 25.14956 6.0478778 -1.176117e-09 152.10145
-#> 130: 12 9.03 4.299781 2.744429 25.14956 4.8833079 -2.115089e-09 122.81303
-#> 131: 12 12.05 4.299781 2.744429 25.14956 3.5122972 2.455099e-09 88.33272
-#> 132: 12 24.15 4.299781 2.744429 25.14956 0.9378821 1.006647e-08 23.58732
+#> id time ka cl v cp depot center
+#> 1: 1 0.00 2.300935 1.427091 38.71162 0.000000 3.199920e+02 0.00000
+#> 2: 1 0.25 2.300935 1.427091 38.71162 3.597596 1.800190e+02 139.26877
+#> 3: 1 0.57 2.300935 1.427091 38.71162 5.962771 8.620795e+01 230.82849
+#> 4: 1 1.12 2.300935 1.427091 38.71162 7.422420 2.431874e+01 287.33387
+#> 5: 1 2.02 2.300935 1.427091 38.71162 7.717302 3.066092e+00 298.74922
+#> ---
+#> 128: 12 5.07 2.042580 3.811162 47.41169 4.683446 1.019822e-02 222.05007
+#> 129: 12 7.07 2.042580 3.811162 47.41169 3.988089 1.715374e-04 189.08201
+#> 130: 12 9.03 2.042580 3.811162 47.41169 3.406753 3.130922e-06 161.51988
+#> 131: 12 12.05 2.042580 3.811162 47.41169 2.672458 6.357558e-09 126.70572
+#> 132: 12 24.15 2.042580 3.811162 47.41169 1.010399 -4.063231e-09 47.90474
diff --git a/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png b/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png
index 5e38bf699..0e2548395 100644
Binary files a/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png and b/articles/rxode2-prior-data_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/articles/rxode2-rxUse.html b/articles/rxode2-rxUse.html
index a7226d7f9..7a9a1d2f8 100644
--- a/articles/rxode2-rxUse.html
+++ b/articles/rxode2-rxUse.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-rxUse.Rmd
rxode2-rxUse.Rmd
diff --git a/articles/rxode2-shiny.html b/articles/rxode2-shiny.html
index a7b3cf592..71879b2fd 100644
--- a/articles/rxode2-shiny.html
+++ b/articles/rxode2-shiny.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 and Shiny
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-shiny.Rmd
rxode2-shiny.Rmd
diff --git a/articles/rxode2-sim-var.html b/articles/rxode2-sim-var.html
index e3dd49b16..597a80bec 100644
--- a/articles/rxode2-sim-var.html
+++ b/articles/rxode2-sim-var.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
rxode2 Simulation
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-sim-var.Rmd
rxode2-sim-var.Rmd
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png
index 0801c48a3..325135031 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png
index f7cbf10f8..932ad602a 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png
index 801724856..49e70f3bd 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-12-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png
index 112f6e4e1..c09ce5fdd 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png
index 04bfe7386..9e5b3aa40 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-14-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png
index a9d3e17ba..437525a0c 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-20-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png
index b373a4f5a..9cddd37c3 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png
index 46ac7e26c..110471fd9 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-23-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png
index 6cd5d0ec2..7b24abb7c 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-28-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png
index a1d57649e..21d84dbd8 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-29-1.png differ
diff --git a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png
index f529935b6..aa1d958e8 100644
Binary files a/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png and b/articles/rxode2-sim-var_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/articles/rxode2-single-subject.html b/articles/rxode2-single-subject.html
index e96a41222..106cf7665 100644
--- a/articles/rxode2-single-subject.html
+++ b/articles/rxode2-single-subject.html
@@ -157,7 +157,7 @@ Advanced Features, Model Types, Techni
Single Subject ODE solving -- differences from multiple subject
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-single-subject.Rmd
rxode2-single-subject.Rmd
diff --git a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png
index fba81cd7f..74fab59ec 100644
Binary files a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png and b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png
index 4415e8355..d08312dc4 100644
Binary files a/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png and b/articles/rxode2-single-subject_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/articles/rxode2-speed.html b/articles/rxode2-speed.html
index d17010558..fe369dd6a 100644
--- a/articles/rxode2-speed.html
+++ b/articles/rxode2-speed.html
@@ -159,7 +159,7 @@ Advanced Features, Model Types, Techni
Matthew
Fidler
- 2023-11-28
+ 2023-11-30
Source: vignettes/rxode2-speed.Rmd
rxode2-speed.Rmd
@@ -262,8 +262,8 @@ A note about t
output. You can see the differences below:
summary(mod1$simulationModel)
-#> rxode2 2.0.14.9000 model named rx_1db0dc8e0f01971bbf76da7db21b2ddc model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_1db0dc8e0f01971bbf76da7db21b2ddc__.rxd/rx_1db0dc8e0f01971bbf76da7db21b2ddc_.so
+#> rxode2 2.0.14.9000 model named rx_dc699e1c896b208ee1d2c3d40f0517f6 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_dc699e1c896b208ee1d2c3d40f0517f6__.rxd/rx_dc699e1c896b208ee1d2c3d40f0517f6_.so
#> NULL
#>
#> Calculated Variables:
@@ -281,8 +281,8 @@ A note about t
#> })
summary(mod1$simulationIniModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_5a1faf720b150ea8bf052c9e377d3541 model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_5a1faf720b150ea8bf052c9e377d3541__.rxd/rx_5a1faf720b150ea8bf052c9e377d3541_.so
+#> rxode2 2.0.14.9000 model named rx_a70bc38d73df7fd8798a4d16d23549b7 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_a70bc38d73df7fd8798a4d16d23549b7__.rxd/rx_a70bc38d73df7fd8798a4d16d23549b7_.so
#> NULL
#>
#> Calculated Variables:
@@ -308,8 +308,8 @@ A note about t
#> })
summary(mod2$simulationModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_89c321f08eb652c4c20174fabb507c1a model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_89c321f08eb652c4c20174fabb507c1a__.rxd/rx_89c321f08eb652c4c20174fabb507c1a_.so
+#> rxode2 2.0.14.9000 model named rx_4f35e2e99d243ab6809555688909b8b5 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_4f35e2e99d243ab6809555688909b8b5__.rxd/rx_4f35e2e99d243ab6809555688909b8b5_.so
#> NULL
#>
#> Calculated Variables:
@@ -365,8 +365,8 @@ A note about t
#> })
summary(mod2$simulationIniModel)
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_2df8872b4615f9e177c35609e2b4f0ac model (✔ ready).
-#> DLL: /tmp/RtmprYXrJy/rxode2/rx_2df8872b4615f9e177c35609e2b4f0ac__.rxd/rx_2df8872b4615f9e177c35609e2b4f0ac_.so
+#> rxode2 2.0.14.9000 model named rx_6e671c0a1d256755528eea1281ce8326 model (✔ ready).
+#> DLL: /tmp/RtmphFlXM3/rxode2/rx_6e671c0a1d256755528eea1281ce8326__.rxd/rx_6e671c0a1d256755528eea1281ce8326_.so
#> NULL
#>
#> Calculated Variables:
@@ -552,10 +552,10 @@ Compare the times between all
print(bench)
#> Unit: milliseconds
#> expr min lq mean median uq max
-#> runFor() 276.22910 280.46886 291.73762 283.01823 286.89760 451.35924
-#> runSapply() 275.08853 280.51578 290.80704 282.79888 287.13135 398.02833
-#> runSingleThread() 30.18147 30.41170 32.09662 30.53664 30.91048 54.01280
-#> run2Thread() 17.77206 18.07482 19.55270 18.23813 18.59497 33.42291
+#> runFor() 270.69599 276.55658 287.34527 279.04749 283.91232 399.33829
+#> runSapply() 270.92489 277.10728 286.33457 279.31426 284.37742 395.99029
+#> runSingleThread() 28.37033 28.55639 29.56166 28.67460 28.90486 47.37217
+#> run2Thread() 16.90444 17.11417 18.66124 17.29484 17.65497 29.40771
#> neval
#> 100
#> 100
@@ -582,10 +582,10 @@ Compare the times between all
print(bench)
#> Unit: milliseconds
#> expr min lq mean median uq max neval
-#> runThread(1) 30.11232 30.44157 32.17729 30.87135 31.89442 53.22333 100
-#> runThread(2) 18.01286 18.35992 20.01757 19.03389 19.27335 30.26586 100
-#> runThread(3) 19.16968 20.63224 21.16056 20.88685 21.64686 26.72507 100
-#> runThread(4) 17.32244 17.52879 19.31132 18.24037 18.41109 33.27417 100
+#> runThread(1) 28.50206 28.80758 30.07428 29.76448 30.28849 51.17343 100
+#> runThread(2) 16.99616 17.40397 19.68778 18.00946 19.60652 29.88473 100
+#> runThread(3) 18.74504 19.83795 20.51225 20.06909 20.67744 28.24697 100
+#> runThread(4) 16.64245 16.94800 19.28947 17.38783 17.77615 38.09974 100
autoplot(bench)
@@ -675,7 +675,7 @@ A real life exampleStoplapply <- Sys.time()
print(Stoplapply - Startlapply)
-#> Time difference of 12.63246 secs
+#> Time difference of 12.56756 secs
By applying some of the new parallel solving concepts you can simply
run the same simulation both with less code and faster:
@@ -716,7 +716,7 @@ A real life exampleres <- rxSolve(rx, ev, omega=omega, returnType="data.table")
endParallel <- Sys.time()
print(endParallel - startParallel)
-#> Time difference of 0.1095562 secs
+#> Time difference of 0.1166935 secs
You can see a striking time difference between the two methods; A few
things to keep in mind:
+#> [1] gtable_0.3.4 xfun_0.41 bslib_0.6.1
+#> [4] RApiSerialize_0.1.2 lattice_0.21-9 vctrs_0.6.4
+#> [7] tools_4.3.2 generics_0.1.3 tibble_3.2.1
+#> [10] symengine_0.2.2 fansi_1.0.5 highr_0.10
+#> [13] pkgconfig_2.0.3 checkmate_2.3.0 desc_1.4.2
+#> [16] RcppParallel_5.1.7 lifecycle_1.0.4 compiler_4.3.2
+#> [19] farver_2.1.1 stringr_1.5.1 textshaping_0.3.7
+#> [22] munsell_0.5.0 qs_0.25.6 htmltools_0.5.7
+#> [25] sys_3.4.2 sass_0.4.7 yaml_2.3.7
+#> [28] lazyeval_0.2.2 pillar_1.9.0 pkgdown_2.0.7
+#> [31] crayon_1.5.2 jquerylib_0.1.4 cachem_1.0.8
+#> [34] nlme_3.1-163 tidyselect_1.2.0 digest_0.6.33
+#> [37] lotri_0.4.4 stringi_1.8.2 dplyr_1.1.4
+#> [40] purrr_1.0.2 rxode2ll_2.0.11.9000 rprojroot_2.0.4
+#> [43] fastmap_1.1.1 grid_4.3.2 colorspace_2.1-0
+#> [46] rxode2parse_2.0.17 cli_3.6.1 dparser_1.3.1-11
+#> [49] magrittr_2.0.3 utf8_1.2.4 withr_2.5.2
+#> [52] scales_1.3.0 backports_1.4.1 rmarkdown_2.25
+#> [55] ragg_1.2.6 stringfish_0.16.0 memoise_2.0.1
+#> [58] evaluate_0.23 knitr_1.45 rex_1.2.1
+#> [61] rxode2et_2.0.11 rxode2random_2.0.12 PreciseSums_0.6
+#> [64] rlang_1.1.2 Rcpp_1.0.11 glue_1.6.2
+#> [67] jsonlite_1.8.7 R6_2.5.1 systemfonts_1.0.5
+#> [70] fs_1.6.3 units_0.8-5
diff --git a/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5 b/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5
new file mode 100644
index 000000000..8a5809ff2
--- /dev/null
+++ b/reference/myapp/mod1.d/712d99b2d4d45a81fea295effcd41875.md5
@@ -0,0 +1 @@
+rxode2
diff --git a/reference/myapp/mod1.d/mod1_.c b/reference/myapp/mod1.d/mod1_.c
index b641e5e35..4ab3a7415 100644
--- a/reference/myapp/mod1.d/mod1_.c
+++ b/reference/myapp/mod1.d/mod1_.c
@@ -1,119 +1,119 @@
-#define _getRxSolve_ _rxmod1_4d6db176c09140d3e32f433895c79e9f0
-#define _evalUdf _rxmod1_4d6db176c09140d3e32f433895c79e9f1
-#define _solveData _rxmod1_4d6db176c09140d3e32f433895c79e9f2
-#define _assign_ptr _rxmod1_4d6db176c09140d3e32f433895c79e9f3
-#define _rxRmModelLib _rxmod1_4d6db176c09140d3e32f433895c79e9f4
-#define _rxGetModelLib _rxmod1_4d6db176c09140d3e32f433895c79e9f5
-#define _old_c _rxmod1_4d6db176c09140d3e32f433895c79e9f6
-#define _ptrid _rxmod1_4d6db176c09140d3e32f433895c79e9f7
-#define _rxIsCurrentC _rxmod1_4d6db176c09140d3e32f433895c79e9f8
-#define _sumPS _rxmod1_4d6db176c09140d3e32f433895c79e9f9
-#define _prodPS _rxmod1_4d6db176c09140d3e32f433895c79e9f10
-#define _prodType _rxmod1_4d6db176c09140d3e32f433895c79e9f11
-#define _sumType _rxmod1_4d6db176c09140d3e32f433895c79e9f12
-#define _update_par_ptr _rxmod1_4d6db176c09140d3e32f433895c79e9f13
-#define _getParCov _rxmod1_4d6db176c09140d3e32f433895c79e9f14
-#define _rxode2_rxAssignPtr _rxmod1_4d6db176c09140d3e32f433895c79e9f15
-#define _rxQr _rxmod1_4d6db176c09140d3e32f433895c79e9f16
-#define _compareFactorVal _rxmod1_4d6db176c09140d3e32f433895c79e9f17
-#define _sum _rxmod1_4d6db176c09140d3e32f433895c79e9f18
-#define _udf _rxmod1_4d6db176c09140d3e32f433895c79e9f19
-#define _sign _rxmod1_4d6db176c09140d3e32f433895c79e9f20
-#define _prod _rxmod1_4d6db176c09140d3e32f433895c79e9f21
-#define _max _rxmod1_4d6db176c09140d3e32f433895c79e9f22
-#define _min _rxmod1_4d6db176c09140d3e32f433895c79e9f23
-#define _transit4P _rxmod1_4d6db176c09140d3e32f433895c79e9f24
-#define _transit3P _rxmod1_4d6db176c09140d3e32f433895c79e9f25
-#define _assignFuns0 _rxmod1_4d6db176c09140d3e32f433895c79e9f26
-#define _assignFuns _rxmod1_4d6db176c09140d3e32f433895c79e9f27
-#define _rxord _rxmod1_4d6db176c09140d3e32f433895c79e9f28
-#define __assignFuns2 _rxmod1_4d6db176c09140d3e32f433895c79e9f29
-#define _llikCauchyDscale _rxmod1_4d6db176c09140d3e32f433895c79e9f30
-#define _llikCauchyDlocation _rxmod1_4d6db176c09140d3e32f433895c79e9f31
-#define _llikCauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f32
-#define _llikGammaDrate _rxmod1_4d6db176c09140d3e32f433895c79e9f33
-#define _llikGammaDshape _rxmod1_4d6db176c09140d3e32f433895c79e9f34
-#define _llikGamma _rxmod1_4d6db176c09140d3e32f433895c79e9f35
-#define _llikWeibullDscale _rxmod1_4d6db176c09140d3e32f433895c79e9f36
-#define _llikWeibullDshape _rxmod1_4d6db176c09140d3e32f433895c79e9f37
-#define _llikWeibull _rxmod1_4d6db176c09140d3e32f433895c79e9f38
-#define _llikUnifDbeta _rxmod1_4d6db176c09140d3e32f433895c79e9f39
-#define _llikUnifDalpha _rxmod1_4d6db176c09140d3e32f433895c79e9f40
-#define _llikUnif _rxmod1_4d6db176c09140d3e32f433895c79e9f41
-#define _llikGeomDp _rxmod1_4d6db176c09140d3e32f433895c79e9f42
-#define _llikGeom _rxmod1_4d6db176c09140d3e32f433895c79e9f43
-#define _llikFDdf2 _rxmod1_4d6db176c09140d3e32f433895c79e9f44
-#define _llikFDdf1 _rxmod1_4d6db176c09140d3e32f433895c79e9f45
-#define _llikF _rxmod1_4d6db176c09140d3e32f433895c79e9f46
-#define _llikExpDrate _rxmod1_4d6db176c09140d3e32f433895c79e9f47
-#define _llikExp _rxmod1_4d6db176c09140d3e32f433895c79e9f48
-#define _llikChisqDdf _rxmod1_4d6db176c09140d3e32f433895c79e9f49
-#define _llikChisq _rxmod1_4d6db176c09140d3e32f433895c79e9f50
-#define _llikTDsd _rxmod1_4d6db176c09140d3e32f433895c79e9f51
-#define _llikTDmean _rxmod1_4d6db176c09140d3e32f433895c79e9f52
-#define _llikTDdf _rxmod1_4d6db176c09140d3e32f433895c79e9f53
-#define _llikT _rxmod1_4d6db176c09140d3e32f433895c79e9f54
-#define _llikBetaDshape2 _rxmod1_4d6db176c09140d3e32f433895c79e9f55
-#define _llikBetaDshape1 _rxmod1_4d6db176c09140d3e32f433895c79e9f56
-#define _llikBeta _rxmod1_4d6db176c09140d3e32f433895c79e9f57
-#define _llikNbinomMuDmu _rxmod1_4d6db176c09140d3e32f433895c79e9f58
-#define _llikNbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f59
-#define _llikNbinomDprob _rxmod1_4d6db176c09140d3e32f433895c79e9f60
-#define _llikNbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f61
-#define _llikBinomDprob _rxmod1_4d6db176c09140d3e32f433895c79e9f62
-#define _llikBinom _rxmod1_4d6db176c09140d3e32f433895c79e9f63
-#define _llikPoisDlambda _rxmod1_4d6db176c09140d3e32f433895c79e9f64
-#define _llikPois _rxmod1_4d6db176c09140d3e32f433895c79e9f65
-#define _llikNormDsd _rxmod1_4d6db176c09140d3e32f433895c79e9f66
-#define _llikNormDmean _rxmod1_4d6db176c09140d3e32f433895c79e9f67
-#define _llikNorm _rxmod1_4d6db176c09140d3e32f433895c79e9f68
-#define simeps _rxmod1_4d6db176c09140d3e32f433895c79e9f69
-#define simeta _rxmod1_4d6db176c09140d3e32f433895c79e9f70
-#define expit _rxmod1_4d6db176c09140d3e32f433895c79e9f71
-#define logit _rxmod1_4d6db176c09140d3e32f433895c79e9f72
-#define gammapDer _rxmod1_4d6db176c09140d3e32f433895c79e9f73
-#define lowergamma _rxmod1_4d6db176c09140d3e32f433895c79e9f74
-#define uppergamma _rxmod1_4d6db176c09140d3e32f433895c79e9f75
-#define gammaqInva _rxmod1_4d6db176c09140d3e32f433895c79e9f76
-#define gammaqInv _rxmod1_4d6db176c09140d3e32f433895c79e9f77
-#define gammapInva _rxmod1_4d6db176c09140d3e32f433895c79e9f78
-#define gammapInv _rxmod1_4d6db176c09140d3e32f433895c79e9f79
-#define gammaq _rxmod1_4d6db176c09140d3e32f433895c79e9f80
-#define gammap _rxmod1_4d6db176c09140d3e32f433895c79e9f81
-#define phi _rxmod1_4d6db176c09140d3e32f433895c79e9f82
-#define riweibull _rxmod1_4d6db176c09140d3e32f433895c79e9f83
-#define riunif _rxmod1_4d6db176c09140d3e32f433895c79e9f84
-#define rit_ _rxmod1_4d6db176c09140d3e32f433895c79e9f85
-#define ripois _rxmod1_4d6db176c09140d3e32f433895c79e9f86
-#define ribeta _rxmod1_4d6db176c09140d3e32f433895c79e9f87
-#define rigamma _rxmod1_4d6db176c09140d3e32f433895c79e9f88
-#define rigeom _rxmod1_4d6db176c09140d3e32f433895c79e9f89
-#define rif _rxmod1_4d6db176c09140d3e32f433895c79e9f90
-#define riexp _rxmod1_4d6db176c09140d3e32f433895c79e9f91
-#define richisq _rxmod1_4d6db176c09140d3e32f433895c79e9f92
-#define ricauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f93
-#define rinbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f94
-#define rinbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f95
-#define ribinom _rxmod1_4d6db176c09140d3e32f433895c79e9f96
-#define rinorm _rxmod1_4d6db176c09140d3e32f433895c79e9f97
-#define rxweibull _rxmod1_4d6db176c09140d3e32f433895c79e9f98
-#define rxunif _rxmod1_4d6db176c09140d3e32f433895c79e9f99
-#define rxt_ _rxmod1_4d6db176c09140d3e32f433895c79e9f100
-#define rxpois _rxmod1_4d6db176c09140d3e32f433895c79e9f101
-#define rxbeta _rxmod1_4d6db176c09140d3e32f433895c79e9f102
-#define rxgamma _rxmod1_4d6db176c09140d3e32f433895c79e9f103
-#define rxgeom _rxmod1_4d6db176c09140d3e32f433895c79e9f104
-#define rxf _rxmod1_4d6db176c09140d3e32f433895c79e9f105
-#define rxexp _rxmod1_4d6db176c09140d3e32f433895c79e9f106
-#define rxchisq _rxmod1_4d6db176c09140d3e32f433895c79e9f107
-#define rxcauchy _rxmod1_4d6db176c09140d3e32f433895c79e9f108
-#define rxnbinomMu _rxmod1_4d6db176c09140d3e32f433895c79e9f109
-#define rxnbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f110
-#define rxbinom _rxmod1_4d6db176c09140d3e32f433895c79e9f111
-#define rxnorm _rxmod1_4d6db176c09140d3e32f433895c79e9f112
-#define linCmtC _rxmod1_4d6db176c09140d3e32f433895c79e9f113
-#define linCmtB _rxmod1_4d6db176c09140d3e32f433895c79e9f114
-#define linCmtA _rxmod1_4d6db176c09140d3e32f433895c79e9f115
+#define _getRxSolve_ _rxmod1_fd70789695b9683637113f50a6fda5e90
+#define _evalUdf _rxmod1_fd70789695b9683637113f50a6fda5e91
+#define _solveData _rxmod1_fd70789695b9683637113f50a6fda5e92
+#define _assign_ptr _rxmod1_fd70789695b9683637113f50a6fda5e93
+#define _rxRmModelLib _rxmod1_fd70789695b9683637113f50a6fda5e94
+#define _rxGetModelLib _rxmod1_fd70789695b9683637113f50a6fda5e95
+#define _old_c _rxmod1_fd70789695b9683637113f50a6fda5e96
+#define _ptrid _rxmod1_fd70789695b9683637113f50a6fda5e97
+#define _rxIsCurrentC _rxmod1_fd70789695b9683637113f50a6fda5e98
+#define _sumPS _rxmod1_fd70789695b9683637113f50a6fda5e99
+#define _prodPS _rxmod1_fd70789695b9683637113f50a6fda5e910
+#define _prodType _rxmod1_fd70789695b9683637113f50a6fda5e911
+#define _sumType _rxmod1_fd70789695b9683637113f50a6fda5e912
+#define _update_par_ptr _rxmod1_fd70789695b9683637113f50a6fda5e913
+#define _getParCov _rxmod1_fd70789695b9683637113f50a6fda5e914
+#define _rxode2_rxAssignPtr _rxmod1_fd70789695b9683637113f50a6fda5e915
+#define _rxQr _rxmod1_fd70789695b9683637113f50a6fda5e916
+#define _compareFactorVal _rxmod1_fd70789695b9683637113f50a6fda5e917
+#define _sum _rxmod1_fd70789695b9683637113f50a6fda5e918
+#define _udf _rxmod1_fd70789695b9683637113f50a6fda5e919
+#define _sign _rxmod1_fd70789695b9683637113f50a6fda5e920
+#define _prod _rxmod1_fd70789695b9683637113f50a6fda5e921
+#define _max _rxmod1_fd70789695b9683637113f50a6fda5e922
+#define _min _rxmod1_fd70789695b9683637113f50a6fda5e923
+#define _transit4P _rxmod1_fd70789695b9683637113f50a6fda5e924
+#define _transit3P _rxmod1_fd70789695b9683637113f50a6fda5e925
+#define _assignFuns0 _rxmod1_fd70789695b9683637113f50a6fda5e926
+#define _assignFuns _rxmod1_fd70789695b9683637113f50a6fda5e927
+#define _rxord _rxmod1_fd70789695b9683637113f50a6fda5e928
+#define __assignFuns2 _rxmod1_fd70789695b9683637113f50a6fda5e929
+#define _llikCauchyDscale _rxmod1_fd70789695b9683637113f50a6fda5e930
+#define _llikCauchyDlocation _rxmod1_fd70789695b9683637113f50a6fda5e931
+#define _llikCauchy _rxmod1_fd70789695b9683637113f50a6fda5e932
+#define _llikGammaDrate _rxmod1_fd70789695b9683637113f50a6fda5e933
+#define _llikGammaDshape _rxmod1_fd70789695b9683637113f50a6fda5e934
+#define _llikGamma _rxmod1_fd70789695b9683637113f50a6fda5e935
+#define _llikWeibullDscale _rxmod1_fd70789695b9683637113f50a6fda5e936
+#define _llikWeibullDshape _rxmod1_fd70789695b9683637113f50a6fda5e937
+#define _llikWeibull _rxmod1_fd70789695b9683637113f50a6fda5e938
+#define _llikUnifDbeta _rxmod1_fd70789695b9683637113f50a6fda5e939
+#define _llikUnifDalpha _rxmod1_fd70789695b9683637113f50a6fda5e940
+#define _llikUnif _rxmod1_fd70789695b9683637113f50a6fda5e941
+#define _llikGeomDp _rxmod1_fd70789695b9683637113f50a6fda5e942
+#define _llikGeom _rxmod1_fd70789695b9683637113f50a6fda5e943
+#define _llikFDdf2 _rxmod1_fd70789695b9683637113f50a6fda5e944
+#define _llikFDdf1 _rxmod1_fd70789695b9683637113f50a6fda5e945
+#define _llikF _rxmod1_fd70789695b9683637113f50a6fda5e946
+#define _llikExpDrate _rxmod1_fd70789695b9683637113f50a6fda5e947
+#define _llikExp _rxmod1_fd70789695b9683637113f50a6fda5e948
+#define _llikChisqDdf _rxmod1_fd70789695b9683637113f50a6fda5e949
+#define _llikChisq _rxmod1_fd70789695b9683637113f50a6fda5e950
+#define _llikTDsd _rxmod1_fd70789695b9683637113f50a6fda5e951
+#define _llikTDmean _rxmod1_fd70789695b9683637113f50a6fda5e952
+#define _llikTDdf _rxmod1_fd70789695b9683637113f50a6fda5e953
+#define _llikT _rxmod1_fd70789695b9683637113f50a6fda5e954
+#define _llikBetaDshape2 _rxmod1_fd70789695b9683637113f50a6fda5e955
+#define _llikBetaDshape1 _rxmod1_fd70789695b9683637113f50a6fda5e956
+#define _llikBeta _rxmod1_fd70789695b9683637113f50a6fda5e957
+#define _llikNbinomMuDmu _rxmod1_fd70789695b9683637113f50a6fda5e958
+#define _llikNbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e959
+#define _llikNbinomDprob _rxmod1_fd70789695b9683637113f50a6fda5e960
+#define _llikNbinom _rxmod1_fd70789695b9683637113f50a6fda5e961
+#define _llikBinomDprob _rxmod1_fd70789695b9683637113f50a6fda5e962
+#define _llikBinom _rxmod1_fd70789695b9683637113f50a6fda5e963
+#define _llikPoisDlambda _rxmod1_fd70789695b9683637113f50a6fda5e964
+#define _llikPois _rxmod1_fd70789695b9683637113f50a6fda5e965
+#define _llikNormDsd _rxmod1_fd70789695b9683637113f50a6fda5e966
+#define _llikNormDmean _rxmod1_fd70789695b9683637113f50a6fda5e967
+#define _llikNorm _rxmod1_fd70789695b9683637113f50a6fda5e968
+#define simeps _rxmod1_fd70789695b9683637113f50a6fda5e969
+#define simeta _rxmod1_fd70789695b9683637113f50a6fda5e970
+#define expit _rxmod1_fd70789695b9683637113f50a6fda5e971
+#define logit _rxmod1_fd70789695b9683637113f50a6fda5e972
+#define gammapDer _rxmod1_fd70789695b9683637113f50a6fda5e973
+#define lowergamma _rxmod1_fd70789695b9683637113f50a6fda5e974
+#define uppergamma _rxmod1_fd70789695b9683637113f50a6fda5e975
+#define gammaqInva _rxmod1_fd70789695b9683637113f50a6fda5e976
+#define gammaqInv _rxmod1_fd70789695b9683637113f50a6fda5e977
+#define gammapInva _rxmod1_fd70789695b9683637113f50a6fda5e978
+#define gammapInv _rxmod1_fd70789695b9683637113f50a6fda5e979
+#define gammaq _rxmod1_fd70789695b9683637113f50a6fda5e980
+#define gammap _rxmod1_fd70789695b9683637113f50a6fda5e981
+#define phi _rxmod1_fd70789695b9683637113f50a6fda5e982
+#define riweibull _rxmod1_fd70789695b9683637113f50a6fda5e983
+#define riunif _rxmod1_fd70789695b9683637113f50a6fda5e984
+#define rit_ _rxmod1_fd70789695b9683637113f50a6fda5e985
+#define ripois _rxmod1_fd70789695b9683637113f50a6fda5e986
+#define ribeta _rxmod1_fd70789695b9683637113f50a6fda5e987
+#define rigamma _rxmod1_fd70789695b9683637113f50a6fda5e988
+#define rigeom _rxmod1_fd70789695b9683637113f50a6fda5e989
+#define rif _rxmod1_fd70789695b9683637113f50a6fda5e990
+#define riexp _rxmod1_fd70789695b9683637113f50a6fda5e991
+#define richisq _rxmod1_fd70789695b9683637113f50a6fda5e992
+#define ricauchy _rxmod1_fd70789695b9683637113f50a6fda5e993
+#define rinbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e994
+#define rinbinom _rxmod1_fd70789695b9683637113f50a6fda5e995
+#define ribinom _rxmod1_fd70789695b9683637113f50a6fda5e996
+#define rinorm _rxmod1_fd70789695b9683637113f50a6fda5e997
+#define rxweibull _rxmod1_fd70789695b9683637113f50a6fda5e998
+#define rxunif _rxmod1_fd70789695b9683637113f50a6fda5e999
+#define rxt_ _rxmod1_fd70789695b9683637113f50a6fda5e9100
+#define rxpois _rxmod1_fd70789695b9683637113f50a6fda5e9101
+#define rxbeta _rxmod1_fd70789695b9683637113f50a6fda5e9102
+#define rxgamma _rxmod1_fd70789695b9683637113f50a6fda5e9103
+#define rxgeom _rxmod1_fd70789695b9683637113f50a6fda5e9104
+#define rxf _rxmod1_fd70789695b9683637113f50a6fda5e9105
+#define rxexp _rxmod1_fd70789695b9683637113f50a6fda5e9106
+#define rxchisq _rxmod1_fd70789695b9683637113f50a6fda5e9107
+#define rxcauchy _rxmod1_fd70789695b9683637113f50a6fda5e9108
+#define rxnbinomMu _rxmod1_fd70789695b9683637113f50a6fda5e9109
+#define rxnbinom _rxmod1_fd70789695b9683637113f50a6fda5e9110
+#define rxbinom _rxmod1_fd70789695b9683637113f50a6fda5e9111
+#define rxnorm _rxmod1_fd70789695b9683637113f50a6fda5e9112
+#define linCmtC _rxmod1_fd70789695b9683637113f50a6fda5e9113
+#define linCmtB _rxmod1_fd70789695b9683637113f50a6fda5e9114
+#define linCmtA _rxmod1_fd70789695b9683637113f50a6fda5e9115
#include
#define __MAX_PROD__ 0
#define _CMT CMT
@@ -684,9 +684,9 @@ extern SEXP mod1__model_vars(void){
SEXP _mv = PROTECT(_rxGetModelLib("mod1__model_vars"));pro++;
if (!_rxIsCurrentC(_mv)){
SEXP hash = PROTECT(allocVector(STRSXP, 1));pro++;
-#define __doBuf__ snprintf(buf, __doBufN__, "un]\"BAAA@QRtHACAAAAAAA[9zAAAv7#aT)CY/*MA==@agtVwYBaiiq@CXx4gYeA~%%=DXEl||L*Kwy+HDC1$LfUH3jK=sPx.mU$&q){YP6^F7vuIYimmjiF\?YDtIAkAsB\"iT1{J;CEf\"$HEJf@#j}$%%3o[CL~|N9[5g{To8:{(Mm>M2&Hz5T[F+zp5B(D:7J%%*z9m32|w5\?I;1)7\"HhGT3qJ*!BG\?#BuIk:O28A6o%%H6#l`@>Ck}(`7^Zg%%(&pl7p`b<~jCB@q}EFSO//9%%S`5kdW9R^`iV>ws7$I6$fB}V#kdx)lNj&l&P6)WY0fN*d_!MyIZ]1v\?mK%%<0`_hEgrk\"W!|QOBNCpB%%P7]{!6n9dJWJ}Rw6AS@Z}5m29MKi7dMr~FdZ434WsSM75xhEoB1KTSRI,v@Ph\?c.NqM\"%%nH0ej:y,_(hoN`\"Q^%%f#i#ue!cWUrhB{=XCqKo{c7+KHs:Oh8SxvI78w5cayw9@`}aBACu0j^`A+K4gvEz1s\?8BL1O:HZ[Uj[gb}]~sAPGOj/HG:%%{WUJ6ZHAf7a!qu]qcUzFp%%&9~HIR,Rei;vA409t(aqc=>*pINAL+8.n2sG)YwMaOX>84U7MHKe<8\"y7");
- char buf[1063];
-#define __doBufN__ 1063
+#define __doBuf__ snprintf(buf, __doBufN__, "un]\"BAAA@QRtHACAAAAAAAjnzAAAv7#aT)^XQ$MAI<8a=W6xYB~1\"d6EJ2}j0D,qrn%%JAPhJf2J%%CM6RZX*jW@R+MjxDOj^J\?O8*i}b5Tm}~W/^tx#d*NNS!OiIAkAqB>uS=mZ7\?C$Jib(ex6zi3n{+o|;mT5r%%EbxnUTg\"sQ/4^^sOJqo@KKAh^WRZk&.qs(|U|+Q@4oFMNvL<;5(OZ=Kg<.({n7j}ZXWLF@kU!C8:y<}y`,V]mSsFe([wrUD#Uf!X0QD!bzdEOXvl3AbVAy6)d.IK=]c_Y#B\"Q|X9X/y|Vp`kIBY[9LUe#y4Ou:\"#f:Fa@,(KCnu>6)m]P8:o/l,t5\"Fb`di&i&vKz|^g^4{j35g=Z`sCu4,>_MKv\"LZ`VY+p[_V]g)H:i*oh*6&*3NQPjVUJ+r>3L|o44ZGCje3J={e4*C3(fbTetD}/N2}SedvLn6f(q0U+|B.*kP>b3@Qf`)}NQa\?X%%l^Vf`vw*N]`/B%%Z_t|/i&DXb\?aV`ads^f7&bmh(W~xygh4v#zUG+~Co9D\"m%%;d]t}<;<~PbTB\"S%%g@hk]{(E53%%3~fu_*zF{8[4ue,1RqKC,7\?5TeH7|QcRGHMu_MQjJ%%o8j$eto[%%|q[VeqA)Q^zM0c5WKLmWKv(JNSNqB>)+/yn\?x1.Advanced Features, Model Types, Techni
+
Examples#>
#>
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
-#> rxode2 2.0.14.9000 model named rx_5e03602f71c2cee9115a893c3df7ca3b model (✔ ready).
+#> rxode2 2.0.14.9000 model named rx_9b3b2a018ed95cc4155beec87f274fb6 model (✔ ready).
#> $state: depot, gut, center, effect
#> $stateExtra: cp
#> $params: tktr, tka, tcl, tv, prop.err, pkadd.err, temax, tec50, tkout, te0, pdadd.err, eta.ktr, eta.ka, eta.cl, eta.v, eta.emax, eta.ec50, eta.kout, eta.e0, CMT, rxerr.cp, rxerr.effect
diff --git a/reference/rxExpandGrid.html b/reference/rxExpandGrid.html
index 2814c23f6..6a791fe3e 100644
--- a/reference/rxExpandGrid.html
+++ b/reference/rxExpandGrid.html
@@ -858,12 +858,12 @@ Examples# \donttest{
microbenchmark::microbenchmark(rxExpandGrid(letters, letters), expand.grid.jc(letters, letters))
#> Unit: microseconds
-#> expr min lq mean median uq
-#> rxExpandGrid(letters, letters) 11.702 13.2345 34.35792 14.1215 15.2835
-#> expand.grid.jc(letters, letters) 16.119 17.7330 82.51096 19.7670 21.9105
+#> expr min lq mean median uq
+#> rxExpandGrid(letters, letters) 11.552 13.124 106.88926 13.6105 14.518
+#> expand.grid.jc(letters, letters) 15.489 17.007 18.79241 18.4795 20.087
#> max neval
-#> 2037.309 100
-#> 3919.700 100
+#> 4314.928 100
+#> 39.854 100
# }
diff --git a/reference/rxPp.html b/reference/rxPp.html
index b58a9175d..7d6672269 100644
--- a/reference/rxPp.html
+++ b/reference/rxPp.html
@@ -205,29 +205,29 @@ Examples
## Sample homogenous Poisson process of rate 1/10
rxPp(10, 1 / 10)
-#> [1] 8.19983 13.67398 15.48588 17.26219 25.86169 46.25349 49.45993 51.13983
-#> [9] 60.37309 60.55272
+#> [1] 26.15775 33.38380 47.94631 54.17793 55.85722 66.26814 73.62000
+#> [8] 106.75224 116.90016 126.39661
## Sample inhomogenous Poisson rate of 1/10
rxPp(10, 1 / 10, gamma = 2, tmax = 100)
-#> [1] 29.84255 44.80297 48.41821 48.74108 62.10962 64.37036 65.37986 66.33762
-#> [9] 70.33763 90.42581
+#> [1] 19.01904 50.51773 52.22514 52.76671 57.93220 59.95101 63.86916 69.82497
+#> [9] 70.21448 70.65940
## Typically the Poisson process times are in a sequential order,
## using randomOrder gives the Poisson process in random order
rxPp(10, 1 / 10, gamma = 2, tmax = 10, randomOrder = TRUE)
-#> [1] 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000
-#> [7] 10.0000000 10.0000000 10.0000000 0.8339647
+#> [1] 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000
+#> [8] 10.000000 10.000000 6.122726
## This uses an arbitrary function to sample a non-homogenous Poisson process
rxPp(10, 1 / 10, prob = function(x) {
1/(1+abs(x))
})
-#> [1] 4.809088 5.063217 13.240161 67.763702 202.342912 401.974004
-#> [7] 491.820102 657.699603 663.916682 679.367688
+#> [1] 76.20239 136.99708 141.49227 242.51418 303.74927 442.45036 475.40954
+#> [8] 558.23538 591.07437 635.88796
diff --git a/reference/rxbeta.html b/reference/rxbeta.html
index 3c2a1c781..0e9e45d45 100644
--- a/reference/rxbeta.html
+++ b/reference/rxbeta.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxbeta(0.5, 0.5, n = 10) # with rxbeta you have to explicitly state n
-#> [1] 0.948145331 0.001016765 0.644318807 0.993701847 0.979697144 0.949854005
-#> [7] 0.644876158 0.561728077 0.023363523 0.491994328
+#> [1] 0.509350000 0.912413304 0.977069379 0.027279110 0.059673210 0.040116272
+#> [7] 0.710132972 0.793500848 0.006985738 0.180815174
rxbeta(5, 1, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.8851638 0.8631380 0.9547609 0.7128931 0.6538095 0.6257093 0.9834406
-#> [8] 0.9192546 0.7131030 0.9451521
+#> [1] 0.8076466 0.8110352 0.7379905 0.7328007 0.7911829 0.4855712 0.5843775
+#> [8] 0.6370308 0.7837448 0.9117020
rxbeta(1, 3)
-#> [1] 0.1415888
+#> [1] 0.2779042
## This example uses `rxbeta` directly in the model
diff --git a/reference/rxbinom.html b/reference/rxbinom.html
index c272cb601..ea95a16b6 100644
--- a/reference/rxbinom.html
+++ b/reference/rxbinom.html
@@ -201,12 +201,12 @@ Examples## Use threefry engine
rxbinom(10, 0.9, n = 10) # with rxbinom you have to explicitly state n
-#> [1] 8 10 10 9 10 10 10 7 10 10
+#> [1] 9 9 8 8 10 9 8 10 9 9
rxbinom(3, 0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0 0 3 3 1 1 1 2 1 1
+#> [1] 2 3 1 2 2 0 2 0 0 1
rxbinom(4, 0.7)
-#> [1] 4
+#> [1] 3
## This example uses `rxbinom` directly in the model
diff --git a/reference/rxcauchy.html b/reference/rxcauchy.html
index 3fa3e11e3..7e153087b 100644
--- a/reference/rxcauchy.html
+++ b/reference/rxcauchy.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxcauchy(0, 1, n = 10) # with rxcauchy you have to explicitly state n
-#> [1] 1.437161 1.130396 9.028303 -2.441286 1.957748 -11.846129
-#> [7] 2.405660 -0.188139 7.723812 -1.144825
+#> [1] -1.3413470 -7.9470343 0.3502155 -1.0087065 0.1895231 -0.8865630
+#> [7] 0.3504988 0.8707094 -16.4643437 -2.0439314
rxcauchy(0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] -17.7902950 0.8126050 4.2694836 0.7802485 -0.2420802 -42.7706503
-#> [7] 3.6251659 -0.2321640 -1.7539678 3.4910751
+#> [1] 1.2173030 -1.6710622 0.7850675 0.1878941 1.8991325 0.2196978
+#> [7] -3.2933655 0.4879173 -1.0001039 -51.8868570
rxcauchy(3)
-#> [1] 0.3137141
+#> [1] 3.389173
## This example uses `rxcauchy` directly in the model
diff --git a/reference/rxchisq.html b/reference/rxchisq.html
index a0cf6f4b4..60af1ff24 100644
--- a/reference/rxchisq.html
+++ b/reference/rxchisq.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxchisq(0.5, n = 10) # with rxchisq you have to explicitly state n
-#> [1] 0.0139859385 0.3190265397 1.4184940213 2.4311943537 0.0646589798
-#> [6] 0.0010045296 0.0002637322 0.0003710849 0.0419879936 0.4165811547
+#> [1] 4.386053e-01 2.394589e-05 4.476409e-06 3.182313e-01 5.428819e-01
+#> [6] 1.177320e+00 1.485223e+00 1.975781e-01 1.858028e-01 3.011321e-03
rxchisq(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 7.6832528 3.5969063 0.9074432 0.7869437 9.6865961 2.4927662
-#> [7] 8.2051424 4.2726586 3.4134593 19.7586564
+#> [1] 1.4302599 2.2884995 4.1638938 10.9317622 2.3443199 1.6247647
+#> [7] 5.9977646 2.6555508 4.9660984 0.7984326
rxchisq(1)
-#> [1] 0.8231536
+#> [1] 7.302332
## This example uses `rxchisq` directly in the model
diff --git a/reference/rxexp.html b/reference/rxexp.html
index 99853d51e..ea56087fa 100644
--- a/reference/rxexp.html
+++ b/reference/rxexp.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxexp(0.5, n = 10) # with rxexp you have to explicitly state n
-#> [1] 0.1826119 0.1928796 1.0888834 0.3422845 1.7706833 2.8608066 3.0147851
-#> [8] 0.2052450 0.3459341 0.3032443
+#> [1] 2.5063330 2.8993883 0.7395998 1.4183406 0.1358327 0.4820661 3.0171991
+#> [8] 0.7060092 0.3121306 0.2673030
rxexp(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.157723701 0.487060771 0.172598899 0.018957722 0.016271587 0.198303609
-#> [7] 0.200185360 0.649411102 0.433291515 0.001504635
+#> [1] 0.001473441 0.742426584 0.155037193 0.171660703 0.022404456 0.341253688
+#> [7] 1.872270927 0.303458674 0.063965722 0.049181592
rxexp(1)
-#> [1] 0.7681564
+#> [1] 1.032471
## This example uses `rxexp` directly in the model
diff --git a/reference/rxf.html b/reference/rxf.html
index 08a91acb8..93eca4e3d 100644
--- a/reference/rxf.html
+++ b/reference/rxf.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxf(0.5, 0.5, n = 10) # with rxf you have to explicitly state n
-#> [1] 1.689198e-04 1.749518e+00 8.957273e+00 4.775518e+01 1.047833e+01
-#> [6] 6.793332e+01 2.441480e+03 5.191033e+02 6.290055e-01 1.508777e-01
+#> [1] 6.487134e-01 6.029017e-01 1.827351e+04 1.909204e+00 2.574643e+01
+#> [6] 2.605475e-03 1.389581e+00 1.477292e-01 6.585338e-04 4.422300e-02
rxf(5, 1, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.2960946 3.5967311 75.1591497 1322.3248706 9.7874130
-#> [6] 1.8277264 0.5442953 0.7410755 0.7197405 2.7066567
+#> [1] 43.8692980 44.6980929 0.0430548 4075.9888069 1.4885375
+#> [6] 11.4684113 2.9502174 4.9623572 1.1885575 4.7529777
rxf(1, 3)
-#> [1] 2.443486
+#> [1] 4.04815
## This example uses `rxf` directly in the model
diff --git a/reference/rxgamma.html b/reference/rxgamma.html
index c3bc4a528..6ef78701d 100644
--- a/reference/rxgamma.html
+++ b/reference/rxgamma.html
@@ -203,14 +203,14 @@ Examples## Use threefry engine
rxgamma(0.5, n = 10) # with rxgamma you have to explicitly state n
-#> [1] 1.43069847 0.18930373 0.51159260 0.17986398 0.04263112 0.45536795
-#> [7] 0.04237756 0.36802807 0.59365338 0.01716892
+#> [1] 0.1894634559 0.3955014939 2.1180269016 0.0124893414 1.9029689758
+#> [6] 0.0007099950 0.0003539078 2.0218610937 0.1698756362 0.1470387595
rxgamma(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3.643775 9.127494 8.110415 6.680438 4.183950 7.530885 7.391197 3.873330
-#> [9] 5.834599 5.620158
+#> [1] 4.490430 4.631281 4.101066 3.004822 2.537177 4.231033 4.323290 2.422572
+#> [9] 4.608253 7.725234
rxgamma(1)
-#> [1] 0.3024885
+#> [1] 0.8117069
## This example uses `rxbeta` directly in the model
diff --git a/reference/rxgeom.html b/reference/rxgeom.html
index 8a8eb9ef4..1b47a22e2 100644
--- a/reference/rxgeom.html
+++ b/reference/rxgeom.html
@@ -198,12 +198,12 @@ Examples## Use threefry engine
rxgeom(0.5, n = 10) # with rxgeom you have to explicitly state n
-#> [1] 5 1 2 0 2 0 0 0 0 2
+#> [1] 0 0 1 0 0 4 0 0 2 1
rxgeom(0.25, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0 0 5 8 11 0 3 2 5 0
+#> [1] 0 2 5 2 5 1 1 0 22 4
rxgeom(0.75)
-#> [1] 1
+#> [1] 0
## This example uses `rxgeom` directly in the model
diff --git a/reference/rxnbinom.html b/reference/rxnbinom.html
index 9beaa2e9a..eda5065d0 100644
--- a/reference/rxnbinom.html
+++ b/reference/rxnbinom.html
@@ -215,16 +215,16 @@ Examples## Use threefry engine
rxnbinom(10, 0.9, n = 10) # with rxbinom you have to explicitly state n
-#> [1] 9 10 9 8 10 8 10 10 10 9
+#> [1] 9 8 9 10 10 10 9 10 9 8
rxnbinom(3, 0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3 2 3 1 3 2 3 2 3 3
+#> [1] 3 3 3 3 3 3 3 3 3 1
rxnbinom(4, 0.7)
-#> [1] 4
+#> [1] 3
# use mu parameter
rxnbinomMu(40, 40, n=10)
-#> [1] 20 21 18 21 18 22 17 21 17 16
+#> [1] 20 18 22 20 18 16 15 20 21 23
## This example uses `rxbinom` directly in the model
diff --git a/reference/rxnormV.html b/reference/rxnormV.html
index f7d9e3fe4..af05f9baa 100644
--- a/reference/rxnormV.html
+++ b/reference/rxnormV.html
@@ -174,14 +174,14 @@ Examples## Use threefry engine
rxnorm(n = 10) # with rxnorm you have to explicitly state n
-#> [1] 1.15042140 0.07515455 -0.78832908 0.56706840 -0.38135750 -0.04144561
-#> [7] 0.05251770 -2.03106871 1.27716574 0.24102078
+#> [1] 0.09733128 0.60045493 -2.07389520 1.14343365 -0.38633998 0.01287412
+#> [7] -0.04752667 -1.51913058 0.37560137 -0.01275985
rxnorm(n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.15059254 -0.30441444 -0.76386537 0.42607109 1.56206816 -0.20525803
-#> [7] 0.02815088 -0.52752063 0.56270745 0.99563644
+#> [1] 0.3180825 -1.1154098 0.1856747 -1.2032700 0.3088301 -0.7022739
+#> [7] 0.8265574 -0.3676887 0.7052192 0.9639559
rxnorm(2, 3) ## The first 2 arguments are the mean and standard deviation
-#> [1] -3.575533
+#> [1] -1.103648
## This example uses `rxnorm` directly in the model
diff --git a/reference/rxord.html b/reference/rxord.html
index a7e263993..8641d0b09 100644
--- a/reference/rxord.html
+++ b/reference/rxord.html
@@ -170,17 +170,17 @@ Examplesrxord(0.5)
#> [1] 2
rxord(0.5)
-#> [1] 2
-rxord(0.5)
#> [1] 1
+rxord(0.5)
+#> [1] 2
# This will give values 1, 2 and 3
rxord(0.3, 0.3)
-#> [1] 2
+#> [1] 1
rxord(0.3, 0.3)
#> [1] 3
rxord(0.3, 0.3)
-#> [1] 2
+#> [1] 3
diff --git a/reference/rxpois.html b/reference/rxpois.html
index 2d61a26b9..e2e0d4e63 100644
--- a/reference/rxpois.html
+++ b/reference/rxpois.html
@@ -196,12 +196,12 @@ Examples## Use threefry engine
rxpois(lambda = 3, n = 10) # with rxpois you have to explicitly state n
-#> [1] 3 6 1 3 5 4 2 3 2 4
+#> [1] 2 5 2 2 1 3 2 3 2 2
rxpois(lambda = 3, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3 3 1 2 4 4 1 2 7 1
+#> [1] 1 2 4 2 5 0 1 3 3 3
rxpois(4) ## The first arguments are the lambda parameter
-#> [1] 4
+#> [1] 5
## This example uses `rxpois` directly in the model
diff --git a/reference/rxt.html b/reference/rxt.html
index 03dd78f42..fdf36db50 100644
--- a/reference/rxt.html
+++ b/reference/rxt.html
@@ -198,14 +198,14 @@ Examples
## Use threefry engine
rxt(df = 3, n = 10) # with rxt you have to explicitly state n
-#> [1] -1.18148834 -0.06646377 -1.57446744 -0.33784956 -0.72437388 0.09331274
-#> [7] -0.84273603 -1.26466847 0.55132509 1.42084910
+#> [1] 0.3757489 -1.0929198 0.4496582 -0.7100168 4.0821279 0.1564602
+#> [7] -2.3129516 0.9455909 -1.3950564 -1.0967017
rxt(df = 3, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] -2.1534885 -1.2935224 -0.1421191 -0.4395098 -0.9433403 0.8660087
-#> [7] -0.6156332 -0.7324325 0.2463557 2.0830450
+#> [1] -0.09560338 2.30004650 -0.44279496 0.40352877 -0.06773039 0.84341867
+#> [7] -0.51744228 -1.88729910 -1.65975277 0.87533914
rxt(4) ## The first argument is the df parameter
-#> [1] 0.9491927
+#> [1] 0.1890926
## This example uses `rxt` directly in the model
diff --git a/reference/rxunif.html b/reference/rxunif.html
index 5e7a93572..55053a897 100644
--- a/reference/rxunif.html
+++ b/reference/rxunif.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxunif(min = 0, max = 4, n = 10) # with rxunif you have to explicitly state n
-#> [1] 2.83621223 1.96992696 3.10756061 1.95011275 2.95676211 3.12595909
-#> [7] 1.90003174 0.06671147 3.94480453 2.89367047
+#> [1] 8.372550e-01 3.583999e+00 2.408055e+00 6.399907e-01 2.294921e-02
+#> [6] 2.839426e+00 6.982711e-05 2.993348e+00 2.264349e+00 1.249635e+00
rxunif(min = 0, max = 4, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 1.870415 2.409909 1.118098 3.214835 3.739250 2.834278 1.476741 3.726650
-#> [9] 1.077344 3.716599
+#> [1] 2.4039488 0.3410682 0.5535628 2.2799663 0.5887105 2.6540469 2.3969818
+#> [8] 2.2524206 3.7296385 3.7817212
rxunif()
-#> [1] 0.6237814
+#> [1] 0.7661502
## This example uses `rxunif` directly in the model
diff --git a/reference/rxweibull.html b/reference/rxweibull.html
index 965d1ef05..8def44e7b 100644
--- a/reference/rxweibull.html
+++ b/reference/rxweibull.html
@@ -199,16 +199,16 @@ Examples
# with rxweibull you have to explicitly state n
rxweibull(shape = 1, scale = 4, n = 10)
-#> [1] 0.2880067 9.6733848 10.0625276 5.2121465 0.1162208 1.7431259
-#> [7] 0.5911653 2.5184338 16.9541216 0.2694327
+#> [1] 0.3874992 3.1784742 0.3866576 0.4752647 11.6122071 5.2736322
+#> [7] 4.8772255 0.7743957 3.6822614 3.1735263
# You can parallelize the simulation using openMP
rxweibull(shape = 1, scale = 4, n = 10, ncores = 2)
-#> [1] 2.3887151 12.8395182 2.4934963 3.5757075 3.2911726 0.8062004
-#> [7] 6.4677394 7.9369076 4.6097734 0.4939880
+#> [1] 0.4541006 8.0030203 3.8028113 4.6215899 0.1147611 0.1336322 0.2441735
+#> [8] 1.8856361 4.7262429 7.3846402
rxweibull(3)
-#> [1] 0.4003905
+#> [1] 0.5283103
## This example uses `rxweibull` directly in the model
diff --git a/reference/stat_amt-1.png b/reference/stat_amt-1.png
index c7e42cfe0..7e7bb0513 100644
Binary files a/reference/stat_amt-1.png and b/reference/stat_amt-1.png differ
diff --git a/reference/stat_amt-2.png b/reference/stat_amt-2.png
index 1096dcf50..2a8021e32 100644
Binary files a/reference/stat_amt-2.png and b/reference/stat_amt-2.png differ
diff --git a/search.json b/search.json
index c1812a91c..766cfe14c 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"user-defined-functions","dir":"Articles","previous_headings":"","what":"User Defined Functions","title":"Integrating User Defined Functions into rxode2","text":"defining models may wished write small R function make function integrate rxode2 somehow. article discusses 2 ways : R-based user function can loaded simple function certain circumstances translated C run efficiently C function define integrate code","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()`"},{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"r-based-user-functions","dir":"Articles","previous_headings":"","what":"R based user functions","title":"Integrating User Defined Functions into rxode2","text":"R-based user function convenient include ODE, slower done written C , C++ compiled language. requested github appropriate example; However, use simple example simply illustrate concepts. Now ODE compiled R functions called solving ODE. Since calling R, forces parallization turned since R single-threaded. also takes time solve since shuttling back forth R C. Lets see simple function performs: terribly bad, even though shuffling R C. can make better converting functions C: C version almost twice fast R version. may noticed conversion also created C versions first derivative. done automatically gives just C versions function, C versions derivatives registers rxode2. allows C versions work rxode2 nlmixr2 models. function setup advance allow type conversion. general derivatives calculated return() statement user defined function. means simply let R return last value instead explictly calling return(). Many people prefer method coding. Even return function, function converted C. github issue, used function convert derivatives: still helpful functions early returns, nlmixr2 models requiring derivatives calculated non-optimized finite differences occurs. gets internals rxode2 nlmixr2 can see easily calculating derivatives: Whereas originally defined function newAbs() use new derivatives calculated well: circumstances, conversion C possible, though can still use R function. requirements R functions integrated rxode2 system: function must set number arguments, variable arguments like f(…) currently allowed. function given argument single number, function return single number requirements met can use R function rxode2. Additional requirements conversion C include: functions use within R function must understood available rxode2. Practically speaking fun2() refers fun1(), fun1() must changed C code available rxode2 changing function fun2() C. functions can include /else assignments simple return statements (either returning value value line ). Special R control structures functions (like lapply) present. function refer package functions mentioned, return() statement present, derivative C functions rxode2’s derivative table updated.","code":"newAbs <- function(x) { if (x < 0) { -x } else { x } } f <- rxode2({ a <- newAbs(time) }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ e <- et(-10, 10, length.out=40) mb1 <- microbenchmark::microbenchmark(withoutC=suppressWarnings(rxSolve(f,e))) library(ggplot2) autoplot(mb1) + rxTheme() # Create C functions automatically with `rxFun()` rxFun(newAbs) #> → finding duplicate expressions in d(newAbs)/d(x)... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in d(newAbs)/d(x)... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> converted R function 'newAbs' to C (will now use in rxode2) #> converted R function 'rx_newAbs_d_x' to C (will now use in rxode2) #> Added derivative table for 'newAbs' # Recompile to use the C functions # Note it would recompile anyway if you didn't do this step, # it just makes sure that it doesn't recompile every step in # the benchmark f <- rxode2({ a <- newAbs(time) }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ mb2 <- microbenchmark::microbenchmark(withC=rxSolve(f,e, cores=1)) mb <- rbind(mb1, mb2) autoplot(mb) + rxTheme() + xgxr::xgx_scale_y_log10() #> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale. print(mb) #> Unit: milliseconds #> expr min lq mean median uq max neval #> withoutC 7.756175 7.847705 8.458881 7.914530 8.094942 13.65840 100 #> withC 2.089166 2.133058 2.486548 2.254109 2.774495 6.45083 100 # Light f_R <- function(actRad, k_0, a_k) { photfac <- a_k * actRad + k_0 if (photfac > 1) { photfac = 1 } return(photfac) } rxFun(f_R) #> function contains return statement; derivatives not calculated #> converted R function 'f_R' to C (will now use in rxode2) rxFromSE(\"Derivative(f_R(actRad, k_0, a_k),k_0)\") #> [1] \"(f_R(actRad,(k_0)+6.05545445239334e-06,a_k)-f_R(actRad,k_0,a_k))/6.05545445239334e-06\" rxFromSE(\"Derivative(newAbs(x),x)\") #> [1] \"rx_newAbs_d_x(x)\""},{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"c-based-functions","dir":"Articles","previous_headings":"","what":"C based functions","title":"Integrating User Defined Functions into rxode2","text":"can add C functions directly rxode2 well using rxFun(): wanted also use C functions expressions derivatives using rxD() function: Removing function rxRmFun() also remove derivative table:","code":"fun <- \" double fun(double a, double b, double c) { return a*a+b*a+c; } \" ## C-code for function rxFun(\"fun\", c(\"a\", \"b\", \"c\"), fun) rxD(\"fun\", list( function(a, b, c) { # derivative of arg1: a paste0(\"2*\", a, \"+\", b) }, function(a, b, c) { # derivative of arg2: b return(a) }, function(a, b, c) { # derivative of arg3: c return(\"0.0\") } )) rxRmFun(\"fun\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"how-rxode2-assigns-compartment-numbers","dir":"Articles","previous_headings":"","what":"How rxode2 assigns compartment numbers","title":"Changing rxode2 compartment numbers","text":"rxode2 automatically assigns compartment numbers parsing. example, Mavoglurant PBPK model following model may used: look printout, can see rxode2 assigned compartment number(s) can also see classic rxode2 model. case use summary() function: case, Venous_Blood assigned compartment 15. Figuring can inconvenient also lead re-numbering compartment simulation estimation datasets. easy probably clearer specify compartment name, tools support compartment numbers. Therefore, way number compartment easily can lead less data modification multiple tools.","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` pbpk <- function() { model({ KbBR = exp(lKbBR) KbMU = exp(lKbMU) KbAD = exp(lKbAD) CLint= exp(lCLint + eta.LClint) KbBO = exp(lKbBO) KbRB = exp(lKbRB) ## Regional blood flows # Cardiac output (L/h) from White et al (1968) CO = (187.00*WT^0.81)*60/1000 QHT = 4.0 *CO/100 QBR = 12.0*CO/100 QMU = 17.0*CO/100 QAD = 5.0 *CO/100 QSK = 5.0 *CO/100 QSP = 3.0 *CO/100 QPA = 1.0 *CO/100 QLI = 25.5*CO/100 QST = 1.0 *CO/100 QGU = 14.0*CO/100 # Hepatic artery blood flow QHA = QLI - (QSP + QPA + QST + QGU) QBO = 5.0 *CO/100 QKI = 19.0*CO/100 QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI) QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB ## Organs' volumes = organs' weights / organs' density VLU = (0.76 *WT/100)/1.051 VHT = (0.47 *WT/100)/1.030 VBR = (2.00 *WT/100)/1.036 VMU = (40.00*WT/100)/1.041 VAD = (21.42*WT/100)/0.916 VSK = (3.71 *WT/100)/1.116 VSP = (0.26 *WT/100)/1.054 VPA = (0.14 *WT/100)/1.045 VLI = (2.57 *WT/100)/1.040 VST = (0.21 *WT/100)/1.050 VGU = (1.44 *WT/100)/1.043 VBO = (14.29*WT/100)/1.990 VKI = (0.44 *WT/100)/1.050 VAB = (2.81 *WT/100)/1.040 VVB = (5.62 *WT/100)/1.040 VRB = (3.86 *WT/100)/1.040 ## Fixed parameters BP = 0.61 # Blood:plasma partition coefficient fup = 0.028 # Fraction unbound in plasma fub = fup/BP # Fraction unbound in blood KbLU = exp(0.8334) KbHT = exp(1.1205) KbSK = exp(-.5238) KbSP = exp(0.3224) KbPA = exp(0.3224) KbLI = exp(1.7604) KbST = exp(0.3224) KbGU = exp(1.2026) KbKI = exp(1.3171) ##----------------------------------------- S15 = VVB*BP/1000 C15 = Venous_Blood/S15 ##----------------------------------------- d/dt(Lungs) = QLU*(Venous_Blood/VVB - Lungs/KbLU/VLU) d/dt(Heart) = QHT*(Arterial_Blood/VAB - Heart/KbHT/VHT) d/dt(Brain) = QBR*(Arterial_Blood/VAB - Brain/KbBR/VBR) d/dt(Muscles) = QMU*(Arterial_Blood/VAB - Muscles/KbMU/VMU) d/dt(Adipose) = QAD*(Arterial_Blood/VAB - Adipose/KbAD/VAD) d/dt(Skin) = QSK*(Arterial_Blood/VAB - Skin/KbSK/VSK) d/dt(Spleen) = QSP*(Arterial_Blood/VAB - Spleen/KbSP/VSP) d/dt(Pancreas) = QPA*(Arterial_Blood/VAB - Pancreas/KbPA/VPA) d/dt(Liver) = QHA*Arterial_Blood/VAB + QSP*Spleen/KbSP/VSP + QPA*Pancreas/KbPA/VPA + QST*Stomach/KbST/VST + QGU*Gut/KbGU/VGU - CLint*fub*Liver/KbLI/VLI - QLI*Liver/KbLI/VLI d/dt(Stomach) = QST*(Arterial_Blood/VAB - Stomach/KbST/VST) d/dt(Gut) = QGU*(Arterial_Blood/VAB - Gut/KbGU/VGU) d/dt(Bones) = QBO*(Arterial_Blood/VAB - Bones/KbBO/VBO) d/dt(Kidneys) = QKI*(Arterial_Blood/VAB - Kidneys/KbKI/VKI) d/dt(Arterial_Blood) = QLU*(Lungs/KbLU/VLU - Arterial_Blood/VAB) d/dt(Venous_Blood) = QHT*Heart/KbHT/VHT + QBR*Brain/KbBR/VBR + QMU*Muscles/KbMU/VMU + QAD*Adipose/KbAD/VAD + QSK*Skin/KbSK/VSK + QLI*Liver/KbLI/VLI + QBO*Bones/KbBO/VBO + QKI*Kidneys/KbKI/VKI + QRB*Rest_of_Body/KbRB/VRB - QLU*Venous_Blood/VVB d/dt(Rest_of_Body) = QRB*(Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) }) } pbpk <- pbpk() print(pbpk) #> -- rxode2-based free-form 16-cmt ODE model ------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 Lungs #> 2 2 Heart #> 3 3 Brain #> 4 4 Muscles #> 5 5 Adipose #> 6 6 Skin #> 7 7 Spleen #> 8 8 Pancreas #> 9 9 Liver #> 10 10 Stomach #> 11 11 Gut #> 12 12 Bones #> 13 13 Kidneys #> 14 14 Arterial_Blood #> 15 15 Venous_Blood #> 16 16 Rest_of_Body #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + #> QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + #> QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + #> QGU * Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - #> QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + #> QSK * Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * #> Bones/KbBO/VBO + QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> }) #> } pbpk <- pbpk$simulationModel #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ summary(pbpk) #> rxode2 2.0.14.9000 model named rx_7ecfe139441efa7d6685fa89a52fedb8 model (ready). #> DLL: /tmp/RtmprYXrJy/rxode2/rx_7ecfe139441efa7d6685fa89a52fedb8__.rxd/rx_7ecfe139441efa7d6685fa89a52fedb8_.so #> NULL #> #> Calculated Variables: #> [1] \"KbBR\" \"KbMU\" \"KbAD\" \"CLint\" \"KbBO\" \"KbRB\" \"CO\" \"QHT\" \"QBR\" #> [10] \"QMU\" \"QAD\" \"QSK\" \"QSP\" \"QPA\" \"QLI\" \"QST\" \"QGU\" \"QHA\" #> [19] \"QBO\" \"QKI\" \"QRB\" \"QLU\" \"VLU\" \"VHT\" \"VBR\" \"VMU\" \"VAD\" #> [28] \"VSK\" \"VSP\" \"VPA\" \"VLI\" \"VST\" \"VGU\" \"VBO\" \"VKI\" \"VAB\" #> [37] \"VVB\" \"VRB\" \"fub\" \"KbLU\" \"KbHT\" \"KbSK\" \"KbSP\" \"KbPA\" \"KbLI\" #> [46] \"KbST\" \"KbGU\" \"KbKI\" \"S15\" \"C15\" #> -- rxode2 Model Syntax -- #> rxode2({ #> param(lKbBR, lKbMU, lKbAD, lCLint, eta.LClint, lKbBO, lKbRB, #> WT) #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + QGU * #> Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + QSK * #> Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * Bones/KbBO/VBO + #> QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> })"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"changing-compartment-numbers-by-pre-declaring-the-compartments","dir":"Articles","previous_headings":"","what":"Changing compartment numbers by pre-declaring the compartments","title":"Changing rxode2 compartment numbers","text":"add compartments rxode2 model order desire simply need pre-declare compartments cmt. example specifying Venous_Blood Skin 1st 2nd compartments, respectively, simple: can see change simple printout first two compartments Venous_Blood followed Skin.","code":"pbpk2 <- function() { model({ ## Now this is the first compartment, ie cmt=1 cmt(Venous_Blood) ## Skin may be a compartment you wish to dose to as well, ## so it is now cmt=2 cmt(Skin) KbBR = exp(lKbBR) KbMU = exp(lKbMU) KbAD = exp(lKbAD) CLint= exp(lCLint + eta.LClint) KbBO = exp(lKbBO) KbRB = exp(lKbRB) ## Regional blood flows # Cardiac output (L/h) from White et al (1968)m CO = (187.00*WT^0.81)*60/1000; QHT = 4.0 *CO/100; QBR = 12.0*CO/100; QMU = 17.0*CO/100; QAD = 5.0 *CO/100; QSK = 5.0 *CO/100; QSP = 3.0 *CO/100; QPA = 1.0 *CO/100; QLI = 25.5*CO/100; QST = 1.0 *CO/100; QGU = 14.0*CO/100; QHA = QLI - (QSP + QPA + QST + QGU); # Hepatic artery blood flow QBO = 5.0 *CO/100; QKI = 19.0*CO/100; QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI); QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB; ## Organs' volumes = organs' weights / organs' density VLU = (0.76 *WT/100)/1.051; VHT = (0.47 *WT/100)/1.030; VBR = (2.00 *WT/100)/1.036; VMU = (40.00*WT/100)/1.041; VAD = (21.42*WT/100)/0.916; VSK = (3.71 *WT/100)/1.116; VSP = (0.26 *WT/100)/1.054; VPA = (0.14 *WT/100)/1.045; VLI = (2.57 *WT/100)/1.040; VST = (0.21 *WT/100)/1.050; VGU = (1.44 *WT/100)/1.043; VBO = (14.29*WT/100)/1.990; VKI = (0.44 *WT/100)/1.050; VAB = (2.81 *WT/100)/1.040; VVB = (5.62 *WT/100)/1.040; VRB = (3.86 *WT/100)/1.040; ## Fixed parameters BP = 0.61; # Blood:plasma partition coefficient fup = 0.028; # Fraction unbound in plasma fub = fup/BP; # Fraction unbound in blood KbLU = exp(0.8334); KbHT = exp(1.1205); KbSK = exp(-.5238); KbSP = exp(0.3224); KbPA = exp(0.3224); KbLI = exp(1.7604); KbST = exp(0.3224); KbGU = exp(1.2026); KbKI = exp(1.3171); ##----------------------------------------- S15 = VVB*BP/1000; C15 = Venous_Blood/S15 ##----------------------------------------- d/dt(Lungs) = QLU*(Venous_Blood/VVB - Lungs/KbLU/VLU); d/dt(Heart) = QHT*(Arterial_Blood/VAB - Heart/KbHT/VHT); d/dt(Brain) = QBR*(Arterial_Blood/VAB - Brain/KbBR/VBR); d/dt(Muscles) = QMU*(Arterial_Blood/VAB - Muscles/KbMU/VMU); d/dt(Adipose) = QAD*(Arterial_Blood/VAB - Adipose/KbAD/VAD); d/dt(Skin) = QSK*(Arterial_Blood/VAB - Skin/KbSK/VSK); d/dt(Spleen) = QSP*(Arterial_Blood/VAB - Spleen/KbSP/VSP); d/dt(Pancreas) = QPA*(Arterial_Blood/VAB - Pancreas/KbPA/VPA); d/dt(Liver) = QHA*Arterial_Blood/VAB + QSP*Spleen/KbSP/VSP + QPA*Pancreas/KbPA/VPA + QST*Stomach/KbST/VST + QGU*Gut/KbGU/VGU - CLint*fub*Liver/KbLI/VLI - QLI*Liver/KbLI/VLI; d/dt(Stomach) = QST*(Arterial_Blood/VAB - Stomach/KbST/VST); d/dt(Gut) = QGU*(Arterial_Blood/VAB - Gut/KbGU/VGU); d/dt(Bones) = QBO*(Arterial_Blood/VAB - Bones/KbBO/VBO); d/dt(Kidneys) = QKI*(Arterial_Blood/VAB - Kidneys/KbKI/VKI); d/dt(Arterial_Blood) = QLU*(Lungs/KbLU/VLU - Arterial_Blood/VAB); d/dt(Venous_Blood) = QHT*Heart/KbHT/VHT + QBR*Brain/KbBR/VBR + QMU*Muscles/KbMU/VMU + QAD*Adipose/KbAD/VAD + QSK*Skin/KbSK/VSK + QLI*Liver/KbLI/VLI + QBO*Bones/KbBO/VBO + QKI*Kidneys/KbKI/VKI + QRB*Rest_of_Body/KbRB/VRB - QLU*Venous_Blood/VVB; d/dt(Rest_of_Body) = QRB*(Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB); }) } pbpk2 <- pbpk2() pbpk2 #> -- rxode2-based free-form 16-cmt ODE model ------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 Venous_Blood #> 2 2 Skin #> 3 3 Lungs #> 4 4 Heart #> 5 5 Brain #> 6 6 Muscles #> 7 7 Adipose #> 8 8 Spleen #> 9 9 Pancreas #> 10 10 Liver #> 11 11 Stomach #> 12 12 Gut #> 13 13 Bones #> 14 14 Kidneys #> 15 15 Arterial_Blood #> 16 16 Rest_of_Body #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> cmt(Venous_Blood) #> cmt(Skin) #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + #> QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + #> QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + #> QGU * Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - #> QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + #> QSK * Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * #> Bones/KbBO/VBO + QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> }) #> }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"appending-compartments-to-the-model","dir":"Articles","previous_headings":"","what":"Appending compartments to the model","title":"Changing rxode2 compartment numbers","text":"can also append “compartments” model. ODE solving internals, add fake compartments model differential equations defined. example legal: can see clearly underlying classic rxode2 model: compartments defined differential equations supported; model : give error:","code":"ode.1c.ka <- function(){ model({ C2 = center/V d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 cmt(eff) }) } ode.1c.ka <- ode.1c.ka() print(ode.1c.ka) #> -- rxode2-based free-form 2-cmt ODE model -------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 center #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> C2 = center/V #> d/dt(depot) = -KA * depot #> d/dt(center) = KA * depot - CL * C2 #> cmt(eff) #> }) #> } ode.1c.ka$simulationModel #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> rxode2 2.0.14.9000 model named rx_4851cdb3054ffc2f3e5f53f3896aac57 model (ready). #> x$state: depot, center #> x$stateExtra: eff #> x$params: V, KA, CL #> x$lhs: C2 ode.1c.ka <- rxode2({ cmt(eff) C2 = center/V; d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 }) Error in rxModelVars_(obj) : Evaluation error: Compartment 'eff' needs differential equations defined."},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-covariates.html","id":"individual-covariates","dir":"Articles","previous_headings":"","what":"Individual Covariates","title":"rxode2 Covariates","text":"individual covariate wish solve may specify iCov dataset:","code":"library(rxode2) ## rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) ## no cache: create with `rxCreateCache()` library(units) ## udunits database from /usr/share/xml/udunits/udunits2.xml library(xgxr) mod3 <- function() { ini({ TKA <- 2.94E-01 ## Clearance with individuals TCL <- 1.86E+01 TV2 <-4.02E+01 TQ <-1.05E+01 TV3 <-2.97E+02 TKin <- 1 TKout <- 1 TEC50 <-200 }) model({ KA <- TKA CL <- TCL * (WT / 70) ^ 0.75 V2 <- TV2 Q <- TQ V3 <- TV3 Kin <- TKin Kout <- TKout EC50 <- TEC50 Tz <- 8 amp <- 0.1 C2 <- central/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(central) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 ## This specifies that the effect compartment starts at 1. }) } ev <- et(amount.units=\"mg\", time.units=\"hours\") %>% et(amt=10000, cmt=1) %>% et(0,48,length.out=100) %>% et(id=1:4) set.seed(10) rxSetSeed(10) ## Now use iCov to simulate a 4-id sample r1 <- solve(mod3, ev, # Create individual covariate data-frame iCov=data.frame(id=1:4, WT=rnorm(4, 70, 10))) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ print(r1) ## ── Solved rxode2 object ── ## ── Parameters ($params): ── ## TKA TCL TV2 TQ TV3 TKin TKout TEC50 Tz amp ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 8.000 0.100 ## ── Initial Conditions ($inits): ── ## depot central peri eff ## 0 0 0 1 ## ── First part of data (object): ── ## # A tibble: 400 × 17 ## id time KA CL V2 Q V3 Kin Kout EC50 C2 C3 depot ## [h] ## 1 1 0 0.294 18.6 40.2 10.5 297 1 1 200 0 0 10000 ## 2 1 0.485 0.294 18.6 40.2 10.5 297 1 1 200 27.8 0.257 8671. ## 3 1 0.970 0.294 18.6 40.2 10.5 297 1 1 200 43.7 0.873 7519. ## 4 1 1.45 0.294 18.6 40.2 10.5 297 1 1 200 51.7 1.68 6520. ## 5 1 1.94 0.294 18.6 40.2 10.5 297 1 1 200 54.7 2.56 5654. ## 6 1 2.42 0.294 18.6 40.2 10.5 297 1 1 200 54.5 3.45 4903. ## # ℹ 394 more rows ## # ℹ 4 more variables: central , peri , eff , WT plot(r1, C2, log=\"y\") ## Warning: Transformation introduced infinite values in continuous y-axis"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-covariates.html","id":"time-varying-covariates","dir":"Articles","previous_headings":"","what":"Time Varying Covariates","title":"rxode2 Covariates","text":"Covariates easy specify rxode2, can specify variable. Time-varying covariates, like clock time circadian rhythm model, can also used. Extending indirect response model already discussed, : Now covariate present event dataset, system can solved combining dataset model: solving ODE equations, solver may sample times outside data. happens, ODE solver can use linear interpolation covariate values. equivalent R’s approxfun method=\"linear\". Note linear approximation case leads kinks solved system 24-hours covariate linear interpolation near 24 near 0. linear seems reasonable, cases like clock time make interpolation methods attractive. rxode2 default covariate interpolation last observation carried forward (locf), constant approximation. equivalent R’s approxfun method=\"constant\". gives following plots: case, plots seem smoother. can also use NONMEM’s preferred interpolation style next observation carried backward (NOCB): gives following plots:","code":"library(rxode2) library(units) mod4 <- mod3 %>% model(d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff) %>% model(-Kin) %>% model(Kin <- TKin + amp *cos(2*pi*(ctime-Tz)/24), append=C2, cov=\"ctime\") ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, cmt=1) %>% et(0,48,length.out=100) ## Create data frame of 8 am dosing for the first dose This is done ## with base R but it can be done with dplyr or data.table ev$ctime <- (ev$time+set_units(8,hr)) %% 24 ev$WT <- 70 r1 <- solve(mod4, ev, covsInterpolation=\"linear\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\") plot(r1,eff) + ylab(\"Effect\") + xlab(\"Time\") r1 <- solve(mod4, ev,covsInterpolation=\"locf\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\", xlab=\"Time\") plot(r1,eff, ylab=\"Effect\", xlab=\"Time\") r1 <- solve(mod4, ev,covsInterpolation=\"nocb\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\", xlab=\"Time\") plot(r1,eff, ylab=\"Effect\", xlab=\"Time\")"},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"creating-an-interactive-data-frame","dir":"Articles","previous_headings":"Using rxode2 data frames","what":"Creating an interactive data frame","title":"rxode2 Data Frames","text":"rxode2 supports returning solved object modified data-frame. done predict(), solve(), rxSolve() methods.","code":"library(rxode2) library(units) ## Setup example model mod1 <- function() { ini({ # central KA <- 2.94E-01 CL <- 1.86E+01 # peripheral V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 # effects Kin <- 1 Kout <- 1 EC50 <- 200 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 }) } ## Seup parameters and initial conditions ## Setup dosing event information ev <- et(amountUnits=\"mg\", timeUnits = \"hours\") %>% et(amt=10000, addl=9, ii=12) %>% et(amt=20000, addl=4, time=120, ii=24) %>% et(0:240) ## Now solve x <- predict(mod1, ev) x #> -- Solved rxode2 object -- #> -- Parameters (x$params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions (x$inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 241 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # i 235 more rows"},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"using-the-solved-object-as-a-simple-data-frame","dir":"Articles","previous_headings":"Using rxode2 data frames","what":"Using the solved object as a simple data frame","title":"rxode2 Data Frames","text":"solved object acts data.frame tbl can filtered dpylr. example filter easily.","code":"library(dplyr) ## You can drop units for comparisons and filtering x <- mod1 %>% solve(ev) %>% drop_units() %>% filter(time <= 3) %>% as_tibble() ## or keep them and compare with the proper units. x <- mod1 %>% solve(ev) %>% filter(time <= set_units(3, hr)) %>% as_tibble() x #> # A tibble: 4 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"updating-the-data-set-interactively","dir":"Articles","previous_headings":"","what":"Updating the data-set interactively","title":"rxode2 Data Frames","text":"However isn’t just simple data object. can use solved object update parameters fly, even change sampling time. First need recreate original solved system:","code":"x <- mod1 %>% solve(ev) print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 241 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # i 235 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"modifying-observation-times-for-rxode2","dir":"Articles","previous_headings":"Updating the data-set interactively","what":"Modifying observation times for rxode2","title":"rxode2 Data Frames","text":"Notice initial effect now 2. can also change sampling times easily method changing t time. example:","code":"x$t <- seq(0,5,length.out=20) print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 20 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 0.263 16.8 0.0817 9255. 677. 24.3 1.01 #> 3 0.526 29.5 0.299 8566. 1187. 88.7 1.03 #> 4 0.789 38.9 0.615 7929. 1562. 183. 1.06 #> 5 1.05 45.5 1.00 7338. 1830. 298. 1.09 #> 6 1.32 50.1 1.44 6792. 2013. 427. 1.12 #> # i 14 more rows plot(x)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"modifying-simulation-parameters","dir":"Articles","previous_headings":"Updating the data-set interactively","what":"Modifying simulation parameters","title":"rxode2 Data Frames","text":"can also access change parameters $ operator. example, accessing KA can done : may change assigning new value. can access/change parameters, initialization(s) events $params, $inits, $events accessor syntax, similar used . syntax makes easy update explore effect various parameters solved object.","code":"x$KA #> [1] 0.294 x$KA <- 1 print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 1.0 18.6 40.2 10.5 297.0 1.0 1.0 200.0 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 20 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 0.263 52.2 0.261 7686. 2098. 77.6 1.03 #> 3 0.526 83.3 0.900 5908. 3348. 267. 1.09 #> 4 0.789 99.8 1.75 4541. 4010. 519. 1.15 #> 5 1.05 106. 2.69 3490. 4273. 800. 1.21 #> 6 1.32 106. 3.66 2683. 4272. 1086. 1.26 #> # i 14 more rows plot(x)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"datasets-for-rxode2-nlmixr","dir":"Articles","previous_headings":"","what":"Datasets for rxode2 & nlmixr","title":"rxode2 Event Types","text":"Data input nlmixr type data input rxode2, similar data NONMEM (NONMEM-ready datasets can used directly nlmixr).","code":""},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"subject-identification-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Subject Identification Columns","title":"rxode2 Event Types","text":"subject identification column separates subjects identification random effects. ID: subject identifier may integer, character, factor.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"observation-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Observation Columns","title":"rxode2 Event Types","text":"Observation columns used indicate dependent variable use measure . DV: numeric column measurement CENS: numeric column indication censoring, limit quantification assay. LIMIT: numeric column helping indicate type censoring, limit quantification assay. MDV: indicator missing DV values CMT: name number compartment DVID: dependent variable identifier EVID event identifier","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dosing-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Dosing Columns","title":"rxode2 Event Types","text":"AMT: amount dose CMT: name number compartment EVID: event identifier ADDL: number additional doses RATE DUR: rate duration dose","code":""},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"details-for-specific-dataset-columns","dir":"Articles","previous_headings":"","what":"Details for Specific Dataset Columns","title":"rxode2 Event Types","text":"details sorted alphabetically column name. grouping use, see documentation .","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"amt-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"AMT Column","title":"rxode2 Event Types","text":"AMT column defines amount dose. observation rows, 0 NA. dosing rows, amount dose administered CMT. dose zero-order rate (constant infusion), infusion may setup using RATE DUR column.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"censlimit-columns","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"CENS/LIMIT Columns","title":"rxode2 Event Types","text":"CENS column indicator column indicating censoring occurred. pharmacokinetic modeling, censoring typically sample limit quantification. Internally rxode2 saves values nlmixr can use likelihood calculations. CENS = 0 indicates value DV measured without censoring. CENS = 1 indicates value left censored (limit quantitation) value DV censoring/quantitation limit. CENS = -1 indicates value right censored (limit quantitation) value DV censoring/quantitation limit. LIMIT additional information censoring handled nlmixr stored rxode2’s data structure well. value left censored, like limit 1 may also believe value certain threshold, like zero. case, limit 0 indicates censored value 0 1. short : CENS = 0 LIMIT ignored observation censored CENS = 1 value censored (LIMIT, DV) CENS = -1 value censored (DV, LIMIT)","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"cmt-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"CMT Column","title":"rxode2 Event Types","text":"CMT column indicates compartment event occurs. given character string factor (preferred method), matched name model. given integer, matched order compartments appear model.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dur-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DUR Column","title":"rxode2 Event Types","text":"DUR column defines duration infusion. used set duration zero-order rate infusion.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dv-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DV Column","title":"rxode2 Event Types","text":"DV column indicates current measurement current compartment (see CMT) current measurement identifier (see DVID) may missing (see MDV) censored (see CENS).","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dvid-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DVID Column","title":"rxode2 Event Types","text":"TODO","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"evid-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"EVID Column","title":"rxode2 Event Types","text":"EVID column event identifier row data. observation records, 0. normal dosing records, 1. Many EVID values detailed rxode2 Event Types Classic rxode2 Events vignettes.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"id-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"ID Column","title":"rxode2 Event Types","text":"ID column subject identifier. column used separate one individual (usually single person animal) another. model, ID column used separate individuals. numerical integrator re-initializes new individual, new values random effects selected.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"rate-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"RATE Column","title":"rxode2 Event Types","text":"TODO","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"creating-rxode2s-event-tables","dir":"Articles","previous_headings":"","what":"Creating rxode2’s event tables","title":"Easy rxode2 Event Tables","text":"event table rxode2 specialized data frame acts container rxode2’s events observation times. create rxode2 event table may use code eventTable(), et(), even create data frame right event information contained . closely related types events rxode2 supports. event table can add sampling/observations doses piping direct access. short table two main functions create dosing Sampling times can added add.sampling( sampling times ) et( sampling times ). Dosing intervals sampling windows also supported. documentation using et() syntax, though supported. models, can illustrate using model shared rxode2 tutorial:","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` library(units) #> udunits database from /usr/share/xml/udunits/udunits2.xml (ev <- et()) #> -- EventTable with 0 records -- #> 0 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) (ev <- et()) #> -- EventTable with 0 records -- #> 0 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) ## Model from rxode2 tutorial m1 <-function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 ## Added modeled bioavaiblity, duration and rate fdepot <- 1 durDepot <- 8 rateDepot <- 1250 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot f(depot) <- fdepot dur(depot) <- durDepot rate(depot) <- rateDepot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff; eff(0) <- 1 }) }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"adding-doses-to-the-event-table","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Adding doses to the event table","title":"Easy rxode2 Event Tables","text":"created can add dosing event table add.dosing(), et() functions. Using add.dosing() function : Notice units specified table. specified, units use units package keep track units convert needed. Additionally, ggforce uses label ggplot axes. set_units drop_units useful set drop rxode2 event table units. example, can see time axes labeled: familiar NONMEM/rxode2 event records, can also specify dosing using et dose elements directly: gives: shows easy creating event tables can .","code":"ev <- eventTable(amount.units=\"mg\", time.units=\"hr\") ## The methods ar attached to the event table, so you can use ## them directly ev$add.dosing(dose=10000, nbr.doses = 3)# loading doses ## Starts at time 0; Default dosing interval is 24 ## You can also pipe the event tables to these methods. ev <- ev %>% add.dosing(dose=5000, nbr.doses=14, dosing.interval=12)# maintenance ev #> -- EventTable with 2 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 2 x 5 #> time amt ii addl evid #> [h] [mg] [h] #> 1 0 10000 24 2 1:Dose (Add) #> 2 0 5000 12 13 1:Dose (Add) rxSolve(m1, ev) %>% plot(C2) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) # loading doses ev #> -- EventTable with 1 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 10000 12 6 1:Dose (Add) rxSolve(m1, ev) %>% plot(C2) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"adding-sampling-to-an-event-table","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Adding sampling to an event table","title":"Easy rxode2 Event Tables","text":"notice examples, rxode2 generated default sampling times since sampling times. wish control sampling time, add samples rxode2 event table add.sampling et gives: use et can simply add similar way add.sampling: gives following rxode2 solve: Note jagged nature plots since sample times.","code":"ev <- eventTable(amount.units=\"mg\", time.units=\"hr\") ## The methods ar attached to the event table, so you can use them ## directly ev$add.dosing(dose=10000, nbr.doses = 3)# loading doses ev$add.sampling(seq(0,24,by=4)) ev #> -- EventTable with 8 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 7 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 8 x 5 #> time amt ii addl evid #> [h] [mg] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 24 2 1:Dose (Add) #> 3 4 NA NA NA 0:Observation #> 4 8 NA NA NA 0:Observation #> 5 12 NA NA NA 0:Observation #> 6 16 NA NA NA 0:Observation #> 7 20 NA NA NA 0:Observation #> 8 24 NA NA NA 0:Observation solve(m1, ev) %>% plot(C2) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) %>% # loading doses et(seq(0,24,by=4)) ev #> -- EventTable with 8 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 7 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 8 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 6 1:Dose (Add) #> 3 4 NA NA NA 0:Observation #> 4 8 NA NA NA 0:Observation #> 5 12 NA NA NA 0:Observation #> 6 16 NA NA NA 0:Observation #> 7 20 NA NA NA 0:Observation #> 8 24 NA NA NA 0:Observation solve(m1, ev) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"expand-the-event-table-to-a-multi-subject-event-table-","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Expand the event table to a multi-subject event table.","title":"Easy rxode2 Event Tables","text":"thing needed expand event table list IDs want expand; can see following simulation 4 individuals solved :","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) %>% # loading doses et(seq(0,48,length.out=200)) %>% et(id=1:4) ev #> -- EventTable with 804 records -- #> 4 dosing records (see x$get.dosing(); add with add.dosing or et) #> 800 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 804 x 6 #> id time amt ii addl evid #> [h] [h] #> 1 1 0 NA NA NA 0:Observation #> 2 1 0 10000 12 6 1:Dose (Add) #> 3 1 0.241 NA NA NA 0:Observation #> 4 1 0.482 NA NA NA 0:Observation #> 5 1 0.724 NA NA NA 0:Observation #> 6 1 0.965 NA NA NA 0:Observation #> 7 1 1.21 NA NA NA 0:Observation #> 8 1 1.45 NA NA NA 0:Observation #> 9 1 1.69 NA NA NA 0:Observation #> 10 1 1.93 NA NA NA 0:Observation #> # i 794 more rows set.seed(42) rxSetSeed(42) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"add-doses-and-samples-within-a-sampling-window","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Add doses and samples within a sampling window","title":"Easy rxode2 Event Tables","text":"addition adding fixed doses fixed sampling times, can windows sample draw doses . dosing windows specify time ordered numerical vector lowest dosing time highest dosing time inside list. example, start dosing time 6 hour dosing window: can clearly see different dosing times following simulation: course reality dosing interval may 2 hours: sort thing can specified sampling times. specify sampling times terms sampling window, can create list sampling times. sampling time two element ordered numeric vector. shows flexibility dosing sampling rxode2 event tables allow.","code":"set.seed(42) rxSetSeed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,6)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) ev #> -- EventTable with 16 records -- #> 16 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 16 x 6 #> id low time high amt evid #> [h] [h] [h] #> 1 1 0 5.49 6 10000 1:Dose (Add) #> 2 1 12 17.0 18 10000 1:Dose (Add) #> 3 1 24 25.7 30 10000 1:Dose (Add) #> 4 1 36 41.6 42 10000 1:Dose (Add) #> 5 2 0 4.31 6 10000 1:Dose (Add) #> 6 2 12 14.7 18 10000 1:Dose (Add) #> 7 2 24 28.2 30 10000 1:Dose (Add) #> 8 2 36 39.9 42 10000 1:Dose (Add) #> 9 3 0 0.808 6 10000 1:Dose (Add) #> 10 3 12 16.4 18 10000 1:Dose (Add) #> 11 3 24 27.1 30 10000 1:Dose (Add) #> 12 3 36 39.9 42 10000 1:Dose (Add) #> 13 4 0 4.98 6 10000 1:Dose (Add) #> 14 4 12 13.7 18 10000 1:Dose (Add) #> 15 4 24 29.6 30 10000 1:Dose (Add) #> 16 4 36 41.5 42 10000 1:Dose (Add) ev <- ev %>% et(seq(0,48,length.out=200)) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) set.seed(42) rxSetSeed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,2)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) %>% et(seq(0,48,length.out=200)) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) rxSetSeed(42) set.seed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,2)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) ## Create 20 samples in the first 24 hours and 20 samples in the ## second 24 hours samples <- c(lapply(1:20, function(...){c(0,24)}), lapply(1:20, function(...){c(20,48)})) ## Add the random collection to the event table ev <- ev %>% et(samples) library(ggplot2) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) + geom_point()"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"combining-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Combining event tables","title":"Easy rxode2 Event Tables","text":"Since can create dosing records sampling records, can create complex dosing regimen wish. addition, rxode2 allows combine event tables c, seq, rep, rbind.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"sequencing-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Sequencing event tables","title":"Easy rxode2 Event Tables","text":"One way combine event table sequence c, seq etSeq. takes two dosing groups adds least one inter-dose interval : sequencing events, can also separate sequence period time; example wanted separate week, easily following sequence event tables: Note example time bid qd event tables exactly one week, 1 week plus 24 hours inter-dose interval. want behavior, can sequence using wait=\"+ii\". Also note, rxode2 assumes dosing want space event tables , clears sampling records combine event tables. true, can also use option samples=\"use\"","code":"## bid for 5 days bid <- et(timeUnits=\"hr\") %>% et(amt=10000,ii=12,until=set_units(5, \"days\")) ## qd for 5 days qd <- et(timeUnits=\"hr\") %>% et(amt=20000,ii=24,until=set_units(5, \"days\")) ## bid for 5 days followed by qd for 5 days et <- seq(bid,qd) %>% et(seq(0,11*24,length.out=100)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days followed by qd for 5 days et <- seq(bid,set_units(1, \"week\"), qd) %>% et(seq(0,18*24,length.out=100)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days followed by qd for 5 days et <- seq(bid,set_units(1, \"week\"), qd,wait=\"+ii\") %>% et(seq(0,18*24,length.out=100)); rxSolve(m1, et) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"repeating-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Repeating event tables","title":"Easy rxode2 Event Tables","text":"can event table can repeat etRep rep. example 4 rounds 2 weeks QD therapy 1 week therapy can simply specified: simplified way use sequence event tables. Therefore, many options still apply; samples cleared unless use samples=\"use\", time event tables least inter-dose interval. can adjust timing wait option.","code":"qd <-et(timeUnits = \"hr\") %>% et(amt=10000, ii=24, until=set_units(2, \"weeks\"), cmt=\"depot\") et <- rep(qd, times=4, wait=set_units(1,\"weeks\")) %>% add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) rxSolve(m1, et) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"combining-event-tables-with-rbind","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Combining event tables with rbind","title":"Easy rxode2 Event Tables","text":"may combine event tables rbind. consider event times combining event tables, keeps times. space event tables waiting period, also consider inter-dose interval. Using previous seq can clearly see difference. sequence: bind together rbind Still waiting period applies (consider inter-dose interval) can also bind tables together make ID event table unique; can good combine cohorts different expected dosing sampling times. requires id=\"unique\" option; Using first example shows different case:","code":"## bid for 5 days bid <- et(timeUnits=\"hr\") %>% et(amt=10000,ii=12,until=set_units(5, \"days\")) ## qd for 5 days qd <- et(timeUnits=\"hr\") %>% et(amt=20000,ii=24,until=set_units(5, \"days\")) et <- seq(bid,qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days et <- rbind(bid,qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) et <- rbind(bid,wait=set_units(10,days),qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days et <- etRbind(bid,qd, id=\"unique\") %>% et(seq(0,150,length.out=500)); library(ggplot2) rxSolve(m1, et) %>% plot(C2) + facet_wrap( ~ id)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"event-tables-in-rstudio-notebooks","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Event tables in Rstudio Notebooks","title":"Easy rxode2 Event Tables","text":"addition output console shown examples, Rstudio notebook output different can seen following screenshots; first screenshot shows event table looks evaluating Rstduio notebook simple dataframe allows page contents. click first box Rstudio notebook output, notes event table: ## Expanding events Event tables can expanded contain addl data item, like following example: can expand events addl items $expand() etExpand(ev): first, etExpand(ev) expands event table without modifying original data frame: can see addl events expanded, however original data frame remained intact: use ev$expand() modify ev object. similar object-oriented method:","code":"ev <- et() %>% et(dose=50, ii=8, until=48) ev #> -- EventTable with 1 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> #> 1 0 50 8 6 1:Dose (Add) etExpand(ev) #> -- EventTable with 7 records -- #> 7 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 7 x 4 #> time amt ii evid #> #> 1 0 50 0 1:Dose (Add) #> 2 8 50 0 1:Dose (Add) #> 3 16 50 0 1:Dose (Add) #> 4 24 50 0 1:Dose (Add) #> 5 32 50 0 1:Dose (Add) #> 6 40 50 0 1:Dose (Add) #> 7 48 50 0 1:Dose (Add) print(ev) #> -- EventTable with 1 records -- #> 1 dosing records (see $get.dosing(); add with add.dosing or et) #> 0 observation times (see $get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with $expand(); or etExpand() #> -- First part of : -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> #> 1 0 50 8 6 1:Dose (Add) ev$expand() ev #> -- EventTable with 7 records -- #> 7 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 7 x 4 #> time amt ii evid #> #> 1 0 50 0 1:Dose (Add) #> 2 8 50 0 1:Dose (Add) #> 3 16 50 0 1:Dose (Add) #> 4 24 50 0 1:Dose (Add) #> 5 32 50 0 1:Dose (Add) #> 6 40 50 0 1:Dose (Add) #> 7 48 50 0 1:Dose (Add)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"rxode2-event-tables","dir":"Articles","previous_headings":"","what":"rxode2 event tables","title":"rxode2 Event Types","text":"general, rxode2 event tables follow NONMEM dataset convention exceptions: may turn compartment negative compartment number “-cmt” cmt compartment name. compartment data item (cmt) can still number, number compartment defined appearance compartment name model. can tedious count, can specify compartment numbers easier using cmt(cmtName) beginning model. Bioavailability changes change rate infusion since dur/amt fixed input data. Similarly, specifying rate/amt infusion, bioavailability change infusion duration since rate/amt fixed input data. infrequent NONMEM columns supported: pcmt, call. evid=5 replace event; replaces value compartment value specified amt column. equivalent deSolve=replace. evid=6 multiply event; multiplies value compartment value specified amt column. equivalent deSolve=multiply. evid=7 transit compartment model/phantom event. puts dose dose() function calculates time since last dose tad() doesn’t actually put dose compartment. allows transit() function easily apply compartment. legal entries data table: notes: evid can classic RxODE (described ) NONMEM-style evid described . NONMEM’s DV required; rxode2 ODE solving framework. NONMEM’s MDV required, since captured EVID. Instead NONMEM-compatible data, can accept deSolve compatible data-frames. returning rxode2 solved data-set additional event ids (EVID) may see depending solving options: EVID = -1 modeled rate ends (corresponds rate = -1) EVID = -2 modeled duration ends (corresponds rate=-2) EVID = -10 rate specified zero-order infusion ends (corresponds rate > 0) EVID = -20 duration specified zero-order infusion ends (corresponds dur > 0) EVID = 101, 102, 103,... correspond 1, 2, 3, … modeled time (mtime). can accessed solving option combination addDosing=TRUE subsetNonmem=FALSE. want see classic EVID equivalents can use addDosing=NA. illustrate event types use model original rxode2 tutorial.","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` ## Model from rxode2 tutorial m1 <- function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 ## Added modeled bioavaiblity, duration and rate fdepot <- 1 durDepot <- 8 rateDepot <- 1250 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot f(depot) <- fdepot dur(depot) <- durDepot rate(depot) <- rateDepot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 }) }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"bolusadditive-doses","dir":"Articles","previous_headings":"","what":"Bolus/Additive Doses","title":"rxode2 Event Types","text":"bolus dose default type dose rxode2 requires amt/dose. Note uses convenience function et() described rxode2 event tables","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 2 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev) %>% plot(C2) + xlab(\"Time\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"infusion-doses","dir":"Articles","previous_headings":"","what":"Infusion Doses","title":"rxode2 Event Types","text":"different type infusions rxode2 supports: Constant Rate Infusion (rate) Constant Duration Infusion (dur) Estimated Rate Infusion Estimated Duration Infusion","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"constant-infusion-in-terms-of-duration-and-rate","dir":"Articles","previous_headings":"Infusion Doses","what":"Constant Infusion (in terms of duration and rate)","title":"rxode2 Event Types","text":"next type event infusion; two ways specify infusion; first dur keyword. example : can also specified rate component: exception bioavailability changes infusion. case modeling rate, bioavailability decrease, decreases infusion duration, NONMEM. example: Similarly increasing bioavailability increases infusion duration. rationale behavior rate amt specified event table, thing can change bioavailability increase duration infusion. specify amt dur components event table, bioavailability changes affect rate infusion. can see side--side comparison bioavailability changes affecting rate instead duration records following plots:","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, dur=8) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt ii addl evid dur #> [h] [h] [h] #> 1 0 NA NA NA 0:Observation NA #> 2 0 10000 12 2 1:Dose (Add) 8 #> 3 0.242 NA NA NA 0:Observation NA #> 4 0.485 NA NA NA 0:Observation NA #> 5 0.727 NA NA NA 0:Observation NA #> 6 0.970 NA NA NA 0:Observation NA #> 7 1.21 NA NA NA 0:Observation NA #> 8 1.45 NA NA NA 0:Observation NA #> 9 1.70 NA NA NA 0:Observation NA #> 10 1.94 NA NA NA 0:Observation NA #> # i 91 more rows rxSolve(m1, ev) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=10000/8) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 1250 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev) %>% plot(depot, C2) + xlab(\"Time\") rxSolve(m1, ev, c(fdepot=0.25)) %>% plot(depot, C2) + xlab(\"Time\") rxSolve(m1, ev, c(fdepot=1.25)) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, dur=8) %>% et(seq(0, 24, length.out=100)) library(ggplot2) library(patchwork) p1 <- rxSolve(m1, ev, c(fdepot=1.25)) %>% plot(depot) + xlab(\"Time\") + ylim(0,5000) p2 <- rxSolve(m1, ev, c(fdepot=0.25)) %>% plot(depot) + xlab(\"Time\")+ ylim(0,5000) ## Use patchwork syntax to combine plots p1 * p2"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"modeled-rate-and-duration-of-infusion","dir":"Articles","previous_headings":"Infusion Doses","what":"Modeled Rate and Duration of Infusion","title":"rxode2 Event Types","text":"can model duration, equivalent NONMEM’s rate=-2. Similarly, may also model rate. equivalent NONMEM’s rate=-1 rxode2’s event table specifies data item well.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=-2) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 -2:dur 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev, c(durDepot=7)) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=-1) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 -1:rate 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev, c(rateDepot=10000/3)) %>% plot(depot, C2) + xlab(\"Time\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state","dir":"Articles","previous_headings":"","what":"Steady State","title":"rxode2 Event Types","text":"doses solved steady state reached constant inter-dose interval.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, ss=1) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 101 x 5 #> time amt ii evid ss #> [h] [h] #> 1 0 NA NA 0:Observation NA #> 2 0 10000 12 1:Dose (Add) 1 #> 3 0.242 NA NA 0:Observation NA #> 4 0.485 NA NA 0:Observation NA #> 5 0.727 NA NA 0:Observation NA #> 6 0.970 NA NA 0:Observation NA #> 7 1.21 NA NA 0:Observation NA #> 8 1.45 NA NA 0:Observation NA #> 9 1.70 NA NA 0:Observation NA #> 10 1.94 NA NA 0:Observation NA #> # i 91 more rows rxSolve(m1, ev) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state-for-complex-dosing","dir":"Articles","previous_headings":"Steady State","what":"Steady state for complex dosing","title":"rxode2 Event Types","text":"using ss=2 flag, can use super-positioning principle linear kinetics get steady state nonstandard dosing (.e. morning 100 mg vs evening 150 mg). done : Saving state values Resetting states solving system steady state Adding back prior state values can see takes full dose cycle reach true complex steady state dosing.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=24, ss=1) %>% et(time=12, amt=15000, ii=24, ss=2) %>% et(time=24, amt=10000, ii=24, addl=3) %>% et(time=36, amt=15000, ii=24, addl=3) %>% et(seq(0, 64, length.out=500)) library(ggplot2) rxSolve(m1, ev,maxsteps=10000) %>% plot(C2) + annotate(\"rect\", xmin=0, xmax=24, ymin=-Inf, ymax=Inf, alpha=0.2) + annotate(\"text\", x=12.5, y=7, label=\"Initial Steady State Period\") + annotate(\"text\", x=44, y=7, label=\"Steady State AM/PM dosing\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state-for-constant-infusion-or-zero-order-processes","dir":"Articles","previous_headings":"Steady State","what":"Steady state for constant infusion or zero order processes","title":"rxode2 Event Types","text":"last type steady state rxode2 supports steady-state constant infusion rate. can specified way NONMEM, : inter-dose interval ii=0 steady state dose, ie ss=1 Either positive rate (rate>0) estimated rate rate=-1. zero dose, ie amt=0 steady-state constant infusion achieved, infusion turned using record, just like NONMEM. Note rate=-2 model duration infusion doesn’t make much sense since solving infusion steady state. duration specified steady state solution. Also note bioavailability changes steady state infusion also make sense neither change rate duration steady state infusion. Hence modeled bioavailability type dosing event ignored. example: can used PK, can used steady-state disease processes.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=0, ss=1,rate=10000/8) p1 <- rxSolve(m1, ev) %>% plot(C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=200000, rate=10000/8) %>% et(0, 250, length.out=1000) p2 <- rxSolve(m1, ev) %>% plot(C2, eff) library(patchwork) p1 / p2"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"reset-events","dir":"Articles","previous_headings":"","what":"Reset Events","title":"rxode2 Event Types","text":"Reset events implemented evid=3 evid=reset, reset evid=4 reset dose. solving show happens system system reset 6 hours post-dose. can see compartments reset initial values. next dose start dosing cycle . case, whole system reset dose given","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, evid=reset) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 3 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, amt=10000, evid=4) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 3 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"turning-off-compartments","dir":"Articles","previous_headings":"","what":"Turning off compartments","title":"rxode2 Event Types","text":"may also turn compartment, similar reset event. Solving shows system: case, depot turned , depot compartment concentrations set initial values compartment concentrations/levels reset. another dose depot administered depot compartment turned back . Note dose compartment turns back compartment dosed. Hence turn effect compartment, continues another dose depot. turn back compartment, zero-dose compartment evid=2 compartment needed.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-depot\", evid=2) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 6 #> time cmt amt ii addl evid #> [h] [h] #> 1 0 (obs) NA NA NA 0:Observation #> 2 0 (default) 10000 12 3 1:Dose (Add) #> 3 0.242 (obs) NA NA NA 0:Observation #> 4 0.485 (obs) NA NA NA 0:Observation #> 5 0.727 (obs) NA NA NA 0:Observation #> 6 0.970 (obs) NA NA NA 0:Observation #> 7 1.21 (obs) NA NA NA 0:Observation #> 8 1.45 (obs) NA NA NA 0:Observation #> 9 1.70 (obs) NA NA NA 0:Observation #> 10 1.94 (obs) NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-eff\", evid=2) %>% et(seq(0, 24, length.out=100)) rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-eff\", evid=2) %>% et(time=12,cmt=\"eff\",evid=2) %>% et(seq(0, 24, length.out=100)) rxSolve(m1, ev) %>% plot(depot,C2, eff)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"classic-rxode-evid-values","dir":"Articles","previous_headings":"","what":"Classic RxODE evid values","title":"Classic rxode2 Events","text":"Originally RxODE supported compound event IDs; rxode2 still supports parameters, often useful use normal NONMEM dataset standard used many modeling tools like NONMEM, Monolix nlmixr, described rxode2 types article. Classically, RxODE supported event coding single event id evid described following table. classic EVID concatenate numbers table, infusion compartment 1 10101 infusion compartment 199 119901. EVID = 0 (observations), EVID=2 (type event) EVID=3 supported. Internally EVID=9 non-observation event makes sure system initialized zero; EVID=9 manually set. EVID 10-99 represents modeled time interventions, similar NONMEM’s MTIME. along amount (amt) time columns specify events ODE system. infusions specified EVIDs > 100 amt column represents rate value. Infusion flags 1 2 +amt turn infusion specific compartment -amt turn infusion specific compartment. specify dose/duration place dosing records time duration starts stops. modeled rate/duration infusion flags infusion flag must followed infusion record. number concatenated together form full RxODE event ID, shown following examples:","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"bolus-dose-examples","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Bolus Dose Examples","title":"Classic rxode2 Events","text":"100 bolus dose compartment #1 time 0 100 bolus dose compartment #99 time 0 100 bolus dose compartment #199 time 0","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"infusion-event-examples","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Infusion Event Examples","title":"Classic rxode2 Events","text":"Bolus infusion rate 50 compartment 1 1.5 hr, (modeled bioavailability changes duration infusion) Bolus infusion rate 50 compartment 1 1.5 hr (modeled bioavailability changes rate infusion) Modeled rate amount 50 Modeled duration amount 50","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"steady-state-for-classic-rxode-evid-example","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Steady State for classic RxODE EVID example","title":"Classic rxode2 Events","text":"Steady state dose cmt 1 Steady State super-positioning principle 50 pm 100 dose","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"steady-state-with-lagged-dose-for-classic-rxode-evid","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Steady state with lagged dose for classic RxODE evid","title":"Classic rxode2 Events","text":"Steady state lagged dose bolus dose: time | evid | amt | ii | 0 | 109 | 100 | 24 | 0 | 101 | 100 | 0 | event 109 calculates trough amount steady state passed (ii-lag_time) event 101 applies next steady state dose. Steady state (=2) lagged bolus dose Steady state infusion lag time time | evid | amt | ii | 0 | 10109 | 5 | 24 | 0 | 10108 | -5 | 24 | 0 | 10101 | 5 | | 20 | 10101 | -5 | | case bolus, 10109 event calculates trough concentration ii=24, may (may ) still infusion running. infusion running 10108 event turn infusion appropriate time. infusion completed, 10108 event ignored. next 2 events 10101 represent event times (assuming bioavailability applied).","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"turning-off-a-compartment-with-classic-rxode-evid","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Turning off a compartment with classic RxODE EVID","title":"Classic rxode2 Events","text":"Turn first compartment time 12 Event coding rxode2 encoded single event number evid. compartments 100, coded : event 0 observation events. 100*(Compartment Number) + 1 dose captured amt 10000 + 100*(Compartment Number) + 1 infusion rate captured amt column infusion turned subtracting amt evid stop infusion. compartments greater equal 100, 100s place digits transferred 100,000th place digit. doses 99th compartment evid bolus dose 9901 evid infusion 19901. bolus dose 199th compartment evid bolus dose 109901. infusion dosing record 199th compartment 119901.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to rxode2","text":"rxode2 R package facilitates simulation ODE models R. designed pharmacometrics models mind, can applied generally ODE model.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"description-of-rxode2-illustrated-through-an-example","dir":"Articles","previous_headings":"","what":"Description of rxode2 illustrated through an example","title":"Introduction to rxode2","text":"model equations can specified text string, model file R expression. differential algebraic equations permitted. Differential equations specified d/dt(var_name) =. equation can separated semicolon. load rxode2 package compile model: Model parameters may specified ini({}) model block, initial conditions can specified within model cmt(0)= X, like model eff(0) <- 1. may also specify subject variability initial conditions residual error components just like nlmixr2. allows single interface nlmixr2/rxode2 models. Also note, classic rxode2 interface still works just like past (don’t worry breaking code time). fact, can get classic rxode2 model $simulationModel ui object:","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` mod1 <- function() { ini({ # central KA=2.94E-01 CL=1.86E+01 V2=4.02E+01 # peripheral Q=1.05E+01 V3=2.97E+02 # effects Kin=1 Kout=1 EC50=200 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 eff(0) <- 1 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff }) } mod1 <- mod1() # create the ui object (can also use `rxode2(mod1)`) mod1 summary(mod1$simulationModel)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"specify-dosing-and-sampling-in-rxode2","dir":"Articles","previous_headings":"Description of rxode2 illustrated through an example","what":"Specify Dosing and sampling in rxode2","title":"Introduction to rxode2","text":"rxode2 provides simple flexible way specify dosing sampling functions generate event table. First, empty event table generated “et()” function. interface similar NONMEM event tables: can see code, can dose compartment named rxode2 model. slight deviation NONMEM can reduce need compartment renumbering. events can also combined expanded (multi-subject events complex regimens) rbind, c, seq, rep. information creating complex dosing regimens using rxode2 see rxode2 events vignette.","code":"ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9,ii=12,cmt=\"depot\") %>% et(time=120, amt=2000, addl=4, ii=14, cmt=\"depot\") %>% et(0:240) # Add sampling"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"solving-odes","dir":"Articles","previous_headings":"Description of rxode2 illustrated through an example","what":"Solving ODEs","title":"Introduction to rxode2","text":"ODE can now solved using rxSolve: returns modified data frame. can see compartment values plot : , Note labels automatically labeled units initial event table. rxode2 extracts units label plot (present).","code":"x <- mod1 %>% rxSolve(ev) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ x #> ── Solved rxode2 object ── #> ── Parameters (x$params): ── #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> ── Initial Conditions (x$inits): ── #> depot centr peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 241 × 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # ℹ 235 more rows library(ggplot2) plot(x,C2) + ylab(\"Central Concentration\") plot(x,eff) + ylab(\"Effect\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"prediction-only-models","dir":"Articles","previous_headings":"","what":"Prediction only models","title":"rxode2 additional model types","text":"Prediction models simple create. use rxode2 syntax without ODE systems . simple example one-compartment model. Solving rxode2 models saving simple ODE system, faster course.","code":"library(rxode2) ## rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) ## no cache: create with `rxCreateCache()` mod <- function(){ model({ ipre <- 10 * exp(-ke * t) }) } et <- et(seq(0,24,length.out=50)) cmt1 <- rxSolve(mod,et,params=c(ke=0.5)) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ cmt1 ## -- Solved rxode2 object -- ## -- Parameters (x$params): -- ## ke ## 0.5 ## -- Initial Conditions (x$inits): -- ## named numeric(0) ## -- First part of data (object): -- ## # A tibble: 50 x 2 ## time ipre ## ## 1 0 10 ## 2 0.490 7.83 ## 3 0.980 6.13 ## 4 1.47 4.80 ## 5 1.96 3.75 ## 6 2.45 2.94 ## # i 44 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"solved-compartment-models","dir":"Articles","previous_headings":"","what":"Solved compartment models","title":"rxode2 additional model types","text":"Solved models also simple create. simply place linCmt() psuedo-function code. linCmt() function figures type model use based parameter names specified. often, pharmacometric models parameterized terms volume clearances. Clearances specified NONMEM-style names CL, Q, Q1, Q2, etc. distributional clearances CLD, CLD2. Volumes specified Central (VC V), Peripheral/Tissue (VP, VT). translations available, example translations : Another popular parameterization terms micro-constants. rxode2 assumes compartment 1 central compartment. elimination constant specified K, Ke Kel. example translations : last parameterization possible using alpha V //B/C. example translations : linCmt() sleuthing complete, 1, 2 3 compartment model solution used value linCmt(). compartments can dose linear solved system depot central linear absorption constant model ka. Without additional ODEs, compartments numbered depot=1 central=2. absorption constant ka missing, may dose central compartment. Without additional ODEs compartment number central=1. compartments take sort events ODE model can take, discussed rxode2 events vignette. acts ODE model; specify dose depot compartment solve system:","code":"mod <- function() { ini({ kel <- 0.5 V <- 1 }) model({ ipre <- linCmt(V, kel) }) } et <- et(amt=10,time=0,cmt=depot) %>% et(seq(0,24,length.out=50)) cmt1 <- rxSolve(mod,et) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ cmt1 ## -- Solved rxode2 object -- ## -- Parameters (x$params): -- ## kel V ## 0.5 1.0 ## -- Initial Conditions (x$inits): -- ## named numeric(0) ## -- First part of data (object): -- ## # A tibble: 50 x 2 ## time ipre ## ## 1 0 10 ## 2 0.490 7.83 ## 3 0.980 6.13 ## 4 1.47 4.80 ## 5 1.96 3.75 ## 6 2.45 2.94 ## # i 44 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"mixing-solved-systems-and-odes","dir":"Articles","previous_headings":"","what":"Mixing Solved Systems and ODEs","title":"rxode2 additional model types","text":"addition pure ODEs, may mix solved systems ODEs. prior 2-compartment indirect response model can simplified linCmt() function: allows indirect response model assign 2-compartment model C2 variable used indirect response model. mixing solved systems ODEs, solved system’s compartment always last compartment. solved system technically isn’t compartment solved. Adding dosing compartment end interfere actual ODE solved. Therefore,two-compartment indirect response model, effect compartment compartment #1 PK dosing compartment depot compartment #2. compartment model requires new event table since compartment number changed: can solved following command: Note solving require specifying effect compartment initial condition 1. Rather, already pre-specified eff(0)=1. can solved different initial conditions easily: rxode2 detective also require specify variables linCmt() function already defined block. Therefore, following function also work solve system. Note specify parameters solving system since built model, can override parameters:","code":"library(rxode2) ## Setup example model mod1 <-function() { model({ C2 = centr/V2 C3 = peri/V3 d/dt(depot) =-KA*depot d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) = Q*C2 - Q*C3 d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff }) } ## Seup parameters and initial conditions theta <- c(KA=2.94E-01, CL=1.86E+01, V2=4.02E+01, # central Q=1.05E+01, V3=2.97E+02, # peripheral Kin=1, Kout=1, EC50=200) # effects inits <- c(eff=1) ## Setup dosing event information ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9, ii=12) %>% et(amt=20000, addl=4, time=120, ii=24) %>% add.sampling(0:240) ## Setup a mixed solved/ode system: mod2 <- function() { model({ ## the order of variables do not matter, the type of compartmental ## model is determined by the parameters specified. C2 = linCmt(KA, CL, V2, Q, V3); eff(0) = 1 ## This specifies that the effect compartment starts at 1. d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff; }) } ev <- et(amountUnits='mg', timeUnits='hours') %>% et(amt=10000, addl=9, ii=12, cmt=2) %>% et(amt=20000, addl=4, time=120, ii=24, cmt=2) %>% et(0:240) x <- mod2 %>% solve(theta, ev) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows x <- mod2 %>% solve(theta, ev,c(eff=2)) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 2 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 2 ## 2 1 121. 1.93 ## 3 2 60.3 1.67 ## 4 3 31.0 1.41 ## 5 4 17.0 1.23 ## 6 5 10.2 1.13 ## # i 235 more rows mod3 <- function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 }) model({ # Since the parameters are in the ini block, put them in linCmt so # that the model is detected correctly C2 <- linCmt(KA, CL, V2, Q, V3) eff(0) <- 1 ## This specifies that the effect compartment starts at 1. d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff; }) } x <- mod3 %>% solve(ev) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows x <- mod3 %>% solve(c(KA=10),ev) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 10.0 18.6 40.2 10.5 297.0 1.0 1.0 200.0 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"nesting-in-rxode2","dir":"Articles","previous_headings":"","what":"Nesting in rxode2","title":"Nesting levels in rxode2","text":"one level nesting possible rxode2; example using following uncertainties sources variability:","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"event-table","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Event table","title":"Nesting levels in rxode2","text":"event table contains nesting variables: inv: investigator id id: subject id eye: eye id (left right) occ: occasion","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9,ii=12,cmt=\"depot\") %>% et(time=120, amt=2000, addl=4, ii=14, cmt=\"depot\") %>% et(seq(0, 240, by=4)) %>% # Assumes sampling when there is no dosing information et(seq(0, 240, by=4) + 0.1) %>% ## adds 0.1 for separate eye et(id=1:20) %>% ## Add an occasion per dose mutate(occ=cumsum(!is.na(amt))) %>% mutate(occ=ifelse(occ == 0, 1, occ)) %>% mutate(occ=2- occ %% 2) %>% mutate(eye=ifelse(round(time) == time, 1, 2)) %>% mutate(inv=ifelse(id < 10, 1, 2)) %>% as_tibble -> ev"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"rxode2-model","dir":"Articles","previous_headings":"Nesting in rxode2","what":"rxode2 model","title":"Nesting levels in rxode2","text":"creates rxode2 model multi-level nesting. Note variables inv.Cl, inv.Ka, eta.Cl etc; need one variable level nesting.","code":"mod <- rxode2({ ## Clearance with individuals eff(0) = 1 C2 = centr/V2*(1+prop.sd) C3 = peri/V3 CL = TCl*exp(eta.Cl + eye.Cl + iov.Cl + inv.Cl) KA = TKA * exp(eta.Ka + eye.Ka + iov.Cl + inv.Ka) d/dt(depot) =-KA*depot d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) = Q*C2 - Q*C3 d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff ef0 = eff + add.sd }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"uncertainty-in-model-parameters","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Uncertainty in Model parameters","title":"Nesting levels in rxode2","text":"","code":"theta <- c(\"TKA\"=0.294, \"TCl\"=18.6, \"V2\"=40.2, \"Q\"=10.5, \"V3\"=297, \"Kin\"=1, \"Kout\"=1, \"EC50\"=200) ## Creating covariance matrix tmp <- matrix(rnorm(8^2), 8, 8) tMat <- tcrossprod(tmp, tmp) / (8 ^ 2) dimnames(tMat) <- list(names(theta), names(theta)) tMat #> TKA TCl V2 Q V3 Kin #> TKA 0.10062025 -0.12295469 -0.04531495 -0.02397077 -0.02434600 -0.04904029 #> TCl -0.12295469 0.25162132 -0.01212188 0.02716814 0.06137190 0.05300572 #> V2 -0.04531495 -0.01212188 0.23379983 -0.02496544 -0.04012738 0.07997442 #> Q -0.02397077 0.02716814 -0.02496544 0.02821405 0.02076256 -0.04388260 #> V3 -0.02434600 0.06137190 -0.04012738 0.02076256 0.16198186 -0.11895883 #> Kin -0.04904029 0.05300572 0.07997442 -0.04388260 -0.11895883 0.26339638 #> Kout -0.03343029 -0.02601856 0.08114984 0.02523323 -0.01569376 -0.03609746 #> EC50 -0.12588070 0.14843107 -0.03577880 0.05992831 0.07451059 -0.02226063 #> Kout EC50 #> TKA -0.03343029 -0.12588070 #> TCl -0.02601856 0.14843107 #> V2 0.08114984 -0.03577880 #> Q 0.02523323 0.05992831 #> V3 -0.01569376 0.07451059 #> Kin -0.03609746 -0.02226063 #> Kout 0.09716982 0.03006571 #> EC50 0.03006571 0.31726414"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"nesting-variability","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Nesting Variability","title":"Nesting levels in rxode2","text":"specify multiple levels nesting, can specify nested lotri matrix; using approach use condition operator | specify variable nesting occurs ; Bayesian simulation need specify much information parameter; rxode2 nu parameter. case: - id, nu=100 model came 100 subjects - eye, nu=200 model came 200 eyes - occ, nu=200 model came 200 occasions - inv, nu=10 model came 10 investigators specify lotri can use | var(nu=X), :","code":"omega <- lotri(lotri(eta.Cl ~ 0.1, eta.Ka ~ 0.1) | id(nu=100), lotri(eye.Cl ~ 0.05, eye.Ka ~ 0.05) | eye(nu=200), lotri(iov.Cl ~ 0.01, iov.Ka ~ 0.01) | occ(nu=200), lotri(inv.Cl ~ 0.02, inv.Ka ~ 0.02) | inv(nu=10)) omega #> $id #> eta.Cl eta.Ka #> eta.Cl 0.1 0.0 #> eta.Ka 0.0 0.1 #> #> $eye #> eye.Cl eye.Ka #> eye.Cl 0.05 0.00 #> eye.Ka 0.00 0.05 #> #> $occ #> iov.Cl iov.Ka #> iov.Cl 0.01 0.00 #> iov.Ka 0.00 0.01 #> #> $inv #> inv.Cl inv.Ka #> inv.Cl 0.02 0.00 #> inv.Ka 0.00 0.02 #> #> Properties: nu"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"unexplained-variability","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Unexplained variability","title":"Nesting levels in rxode2","text":"last piece variability specify unexplained variability","code":"sigma <- lotri(prop.sd ~ .25, add.sd~ 0.125)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"solving-the-problem","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Solving the problem","title":"Nesting levels in rxode2","text":"multiple investigators study; investigator number individuals enrolled site. rxode2 automatically determines number investigators simulate effect investigator. output, inv.Cl(inv==1) inv.Cl investigator 1, inv.Cl(inv==2) inv.Cl investigator 2, etc. inv.Cl(inv==1), inv.Cl(inv==2), etc simulated study combined form investigator variability. equation form represent following: look simulated parameters can see inv.Cl(inv==1) inv.Cl(inv==2) s$params; study: eye variability occasion variability individual simulates number variables become eye occasion variability; case eye: look simulation variables (ie eye.Cl(eye==1), eye.Cl(eye==2), etc) change individual combined make eye variability occasion variability can seen pharamcometric models.","code":"s <- rxSolve(mod, theta, ev, thetaMat=tMat, omega=omega, sigma=sigma, sigmaDf=400, nStud=400) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout #> @(lsoda.c:750 #> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout #> @(lsoda.c:750 #> Warning: some ID(s) could not solve the ODEs correctly; These values are #> replaced with 'NA' print(s) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> # A tibble: 8,000 x 24 #> sim.id id `inv.Cl(inv==1)` `inv.Cl(inv==2)` `inv.Ka(inv==1)` #> #> 1 1 1 -0.0390 -0.0402 -0.0942 #> 2 1 2 -0.0390 -0.0402 -0.0942 #> 3 1 3 -0.0390 -0.0402 -0.0942 #> 4 1 4 -0.0390 -0.0402 -0.0942 #> 5 1 5 -0.0390 -0.0402 -0.0942 #> 6 1 6 -0.0390 -0.0402 -0.0942 #> 7 1 7 -0.0390 -0.0402 -0.0942 #> 8 1 8 -0.0390 -0.0402 -0.0942 #> 9 1 9 -0.0390 -0.0402 -0.0942 #> 10 1 10 -0.0390 -0.0402 -0.0942 #> # i 7,990 more rows #> # i 19 more variables: `inv.Ka(inv==2)` , `eye.Cl(eye==1)` , #> # `eye.Cl(eye==2)` , `eye.Ka(eye==1)` , `eye.Ka(eye==2)` , #> # `iov.Cl(occ==1)` , `iov.Cl(occ==2)` , `iov.Ka(occ==1)` , #> # `iov.Ka(occ==2)` , V2 , V3 , TCl , eta.Cl , #> # TKA , eta.Ka , Q , Kin , Kout , EC50 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> #> Simulation with uncertainty in: #> * parameters ($thetaMat for changes) #> * omega matrix ($omegaList) #> #> -- First part of data (object): -- #> # A tibble: 976,000 x 21 #> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2 C3 #> [h] #> 1 1 1 0 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 0 0 #> 2 1 1 0.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 1.24 0.00724 #> 3 1 1 4 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 16.5 5.02 #> 4 1 1 4.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 32.3 5.15 #> 5 1 1 8 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 21.8 8.35 #> 6 1 1 8.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 12.6 8.40 #> # i 975,994 more rows #> # i 10 more variables: CL , KA , ef0 , depot , centr , #> # peri , eff
Examples
## Sample homogenous Poisson process of rate 1/10
rxPp(10, 1 / 10)
-#> [1] 8.19983 13.67398 15.48588 17.26219 25.86169 46.25349 49.45993 51.13983
-#> [9] 60.37309 60.55272
+#> [1] 26.15775 33.38380 47.94631 54.17793 55.85722 66.26814 73.62000
+#> [8] 106.75224 116.90016 126.39661
## Sample inhomogenous Poisson rate of 1/10
rxPp(10, 1 / 10, gamma = 2, tmax = 100)
-#> [1] 29.84255 44.80297 48.41821 48.74108 62.10962 64.37036 65.37986 66.33762
-#> [9] 70.33763 90.42581
+#> [1] 19.01904 50.51773 52.22514 52.76671 57.93220 59.95101 63.86916 69.82497
+#> [9] 70.21448 70.65940
## Typically the Poisson process times are in a sequential order,
## using randomOrder gives the Poisson process in random order
rxPp(10, 1 / 10, gamma = 2, tmax = 10, randomOrder = TRUE)
-#> [1] 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000
-#> [7] 10.0000000 10.0000000 10.0000000 0.8339647
+#> [1] 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000
+#> [8] 10.000000 10.000000 6.122726
## This uses an arbitrary function to sample a non-homogenous Poisson process
rxPp(10, 1 / 10, prob = function(x) {
1/(1+abs(x))
})
-#> [1] 4.809088 5.063217 13.240161 67.763702 202.342912 401.974004
-#> [7] 491.820102 657.699603 663.916682 679.367688
+#> [1] 76.20239 136.99708 141.49227 242.51418 303.74927 442.45036 475.40954
+#> [8] 558.23538 591.07437 635.88796
diff --git a/reference/rxbeta.html b/reference/rxbeta.html
index 3c2a1c781..0e9e45d45 100644
--- a/reference/rxbeta.html
+++ b/reference/rxbeta.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxbeta(0.5, 0.5, n = 10) # with rxbeta you have to explicitly state n
-#> [1] 0.948145331 0.001016765 0.644318807 0.993701847 0.979697144 0.949854005
-#> [7] 0.644876158 0.561728077 0.023363523 0.491994328
+#> [1] 0.509350000 0.912413304 0.977069379 0.027279110 0.059673210 0.040116272
+#> [7] 0.710132972 0.793500848 0.006985738 0.180815174
rxbeta(5, 1, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.8851638 0.8631380 0.9547609 0.7128931 0.6538095 0.6257093 0.9834406
-#> [8] 0.9192546 0.7131030 0.9451521
+#> [1] 0.8076466 0.8110352 0.7379905 0.7328007 0.7911829 0.4855712 0.5843775
+#> [8] 0.6370308 0.7837448 0.9117020
rxbeta(1, 3)
-#> [1] 0.1415888
+#> [1] 0.2779042
## This example uses `rxbeta` directly in the model
diff --git a/reference/rxbinom.html b/reference/rxbinom.html
index c272cb601..ea95a16b6 100644
--- a/reference/rxbinom.html
+++ b/reference/rxbinom.html
@@ -201,12 +201,12 @@ Examples## Use threefry engine
rxbinom(10, 0.9, n = 10) # with rxbinom you have to explicitly state n
-#> [1] 8 10 10 9 10 10 10 7 10 10
+#> [1] 9 9 8 8 10 9 8 10 9 9
rxbinom(3, 0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0 0 3 3 1 1 1 2 1 1
+#> [1] 2 3 1 2 2 0 2 0 0 1
rxbinom(4, 0.7)
-#> [1] 4
+#> [1] 3
## This example uses `rxbinom` directly in the model
diff --git a/reference/rxcauchy.html b/reference/rxcauchy.html
index 3fa3e11e3..7e153087b 100644
--- a/reference/rxcauchy.html
+++ b/reference/rxcauchy.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxcauchy(0, 1, n = 10) # with rxcauchy you have to explicitly state n
-#> [1] 1.437161 1.130396 9.028303 -2.441286 1.957748 -11.846129
-#> [7] 2.405660 -0.188139 7.723812 -1.144825
+#> [1] -1.3413470 -7.9470343 0.3502155 -1.0087065 0.1895231 -0.8865630
+#> [7] 0.3504988 0.8707094 -16.4643437 -2.0439314
rxcauchy(0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] -17.7902950 0.8126050 4.2694836 0.7802485 -0.2420802 -42.7706503
-#> [7] 3.6251659 -0.2321640 -1.7539678 3.4910751
+#> [1] 1.2173030 -1.6710622 0.7850675 0.1878941 1.8991325 0.2196978
+#> [7] -3.2933655 0.4879173 -1.0001039 -51.8868570
rxcauchy(3)
-#> [1] 0.3137141
+#> [1] 3.389173
## This example uses `rxcauchy` directly in the model
diff --git a/reference/rxchisq.html b/reference/rxchisq.html
index a0cf6f4b4..60af1ff24 100644
--- a/reference/rxchisq.html
+++ b/reference/rxchisq.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxchisq(0.5, n = 10) # with rxchisq you have to explicitly state n
-#> [1] 0.0139859385 0.3190265397 1.4184940213 2.4311943537 0.0646589798
-#> [6] 0.0010045296 0.0002637322 0.0003710849 0.0419879936 0.4165811547
+#> [1] 4.386053e-01 2.394589e-05 4.476409e-06 3.182313e-01 5.428819e-01
+#> [6] 1.177320e+00 1.485223e+00 1.975781e-01 1.858028e-01 3.011321e-03
rxchisq(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 7.6832528 3.5969063 0.9074432 0.7869437 9.6865961 2.4927662
-#> [7] 8.2051424 4.2726586 3.4134593 19.7586564
+#> [1] 1.4302599 2.2884995 4.1638938 10.9317622 2.3443199 1.6247647
+#> [7] 5.9977646 2.6555508 4.9660984 0.7984326
rxchisq(1)
-#> [1] 0.8231536
+#> [1] 7.302332
## This example uses `rxchisq` directly in the model
diff --git a/reference/rxexp.html b/reference/rxexp.html
index 99853d51e..ea56087fa 100644
--- a/reference/rxexp.html
+++ b/reference/rxexp.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxexp(0.5, n = 10) # with rxexp you have to explicitly state n
-#> [1] 0.1826119 0.1928796 1.0888834 0.3422845 1.7706833 2.8608066 3.0147851
-#> [8] 0.2052450 0.3459341 0.3032443
+#> [1] 2.5063330 2.8993883 0.7395998 1.4183406 0.1358327 0.4820661 3.0171991
+#> [8] 0.7060092 0.3121306 0.2673030
rxexp(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.157723701 0.487060771 0.172598899 0.018957722 0.016271587 0.198303609
-#> [7] 0.200185360 0.649411102 0.433291515 0.001504635
+#> [1] 0.001473441 0.742426584 0.155037193 0.171660703 0.022404456 0.341253688
+#> [7] 1.872270927 0.303458674 0.063965722 0.049181592
rxexp(1)
-#> [1] 0.7681564
+#> [1] 1.032471
## This example uses `rxexp` directly in the model
diff --git a/reference/rxf.html b/reference/rxf.html
index 08a91acb8..93eca4e3d 100644
--- a/reference/rxf.html
+++ b/reference/rxf.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxf(0.5, 0.5, n = 10) # with rxf you have to explicitly state n
-#> [1] 1.689198e-04 1.749518e+00 8.957273e+00 4.775518e+01 1.047833e+01
-#> [6] 6.793332e+01 2.441480e+03 5.191033e+02 6.290055e-01 1.508777e-01
+#> [1] 6.487134e-01 6.029017e-01 1.827351e+04 1.909204e+00 2.574643e+01
+#> [6] 2.605475e-03 1.389581e+00 1.477292e-01 6.585338e-04 4.422300e-02
rxf(5, 1, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.2960946 3.5967311 75.1591497 1322.3248706 9.7874130
-#> [6] 1.8277264 0.5442953 0.7410755 0.7197405 2.7066567
+#> [1] 43.8692980 44.6980929 0.0430548 4075.9888069 1.4885375
+#> [6] 11.4684113 2.9502174 4.9623572 1.1885575 4.7529777
rxf(1, 3)
-#> [1] 2.443486
+#> [1] 4.04815
## This example uses `rxf` directly in the model
diff --git a/reference/rxgamma.html b/reference/rxgamma.html
index c3bc4a528..6ef78701d 100644
--- a/reference/rxgamma.html
+++ b/reference/rxgamma.html
@@ -203,14 +203,14 @@ Examples## Use threefry engine
rxgamma(0.5, n = 10) # with rxgamma you have to explicitly state n
-#> [1] 1.43069847 0.18930373 0.51159260 0.17986398 0.04263112 0.45536795
-#> [7] 0.04237756 0.36802807 0.59365338 0.01716892
+#> [1] 0.1894634559 0.3955014939 2.1180269016 0.0124893414 1.9029689758
+#> [6] 0.0007099950 0.0003539078 2.0218610937 0.1698756362 0.1470387595
rxgamma(5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3.643775 9.127494 8.110415 6.680438 4.183950 7.530885 7.391197 3.873330
-#> [9] 5.834599 5.620158
+#> [1] 4.490430 4.631281 4.101066 3.004822 2.537177 4.231033 4.323290 2.422572
+#> [9] 4.608253 7.725234
rxgamma(1)
-#> [1] 0.3024885
+#> [1] 0.8117069
## This example uses `rxbeta` directly in the model
diff --git a/reference/rxgeom.html b/reference/rxgeom.html
index 8a8eb9ef4..1b47a22e2 100644
--- a/reference/rxgeom.html
+++ b/reference/rxgeom.html
@@ -198,12 +198,12 @@ Examples## Use threefry engine
rxgeom(0.5, n = 10) # with rxgeom you have to explicitly state n
-#> [1] 5 1 2 0 2 0 0 0 0 2
+#> [1] 0 0 1 0 0 4 0 0 2 1
rxgeom(0.25, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0 0 5 8 11 0 3 2 5 0
+#> [1] 0 2 5 2 5 1 1 0 22 4
rxgeom(0.75)
-#> [1] 1
+#> [1] 0
## This example uses `rxgeom` directly in the model
diff --git a/reference/rxnbinom.html b/reference/rxnbinom.html
index 9beaa2e9a..eda5065d0 100644
--- a/reference/rxnbinom.html
+++ b/reference/rxnbinom.html
@@ -215,16 +215,16 @@ Examples## Use threefry engine
rxnbinom(10, 0.9, n = 10) # with rxbinom you have to explicitly state n
-#> [1] 9 10 9 8 10 8 10 10 10 9
+#> [1] 9 8 9 10 10 10 9 10 9 8
rxnbinom(3, 0.5, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3 2 3 1 3 2 3 2 3 3
+#> [1] 3 3 3 3 3 3 3 3 3 1
rxnbinom(4, 0.7)
-#> [1] 4
+#> [1] 3
# use mu parameter
rxnbinomMu(40, 40, n=10)
-#> [1] 20 21 18 21 18 22 17 21 17 16
+#> [1] 20 18 22 20 18 16 15 20 21 23
## This example uses `rxbinom` directly in the model
diff --git a/reference/rxnormV.html b/reference/rxnormV.html
index f7d9e3fe4..af05f9baa 100644
--- a/reference/rxnormV.html
+++ b/reference/rxnormV.html
@@ -174,14 +174,14 @@ Examples## Use threefry engine
rxnorm(n = 10) # with rxnorm you have to explicitly state n
-#> [1] 1.15042140 0.07515455 -0.78832908 0.56706840 -0.38135750 -0.04144561
-#> [7] 0.05251770 -2.03106871 1.27716574 0.24102078
+#> [1] 0.09733128 0.60045493 -2.07389520 1.14343365 -0.38633998 0.01287412
+#> [7] -0.04752667 -1.51913058 0.37560137 -0.01275985
rxnorm(n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 0.15059254 -0.30441444 -0.76386537 0.42607109 1.56206816 -0.20525803
-#> [7] 0.02815088 -0.52752063 0.56270745 0.99563644
+#> [1] 0.3180825 -1.1154098 0.1856747 -1.2032700 0.3088301 -0.7022739
+#> [7] 0.8265574 -0.3676887 0.7052192 0.9639559
rxnorm(2, 3) ## The first 2 arguments are the mean and standard deviation
-#> [1] -3.575533
+#> [1] -1.103648
## This example uses `rxnorm` directly in the model
diff --git a/reference/rxord.html b/reference/rxord.html
index a7e263993..8641d0b09 100644
--- a/reference/rxord.html
+++ b/reference/rxord.html
@@ -170,17 +170,17 @@ Examplesrxord(0.5)
#> [1] 2
rxord(0.5)
-#> [1] 2
-rxord(0.5)
#> [1] 1
+rxord(0.5)
+#> [1] 2
# This will give values 1, 2 and 3
rxord(0.3, 0.3)
-#> [1] 2
+#> [1] 1
rxord(0.3, 0.3)
#> [1] 3
rxord(0.3, 0.3)
-#> [1] 2
+#> [1] 3
diff --git a/reference/rxpois.html b/reference/rxpois.html
index 2d61a26b9..e2e0d4e63 100644
--- a/reference/rxpois.html
+++ b/reference/rxpois.html
@@ -196,12 +196,12 @@ Examples## Use threefry engine
rxpois(lambda = 3, n = 10) # with rxpois you have to explicitly state n
-#> [1] 3 6 1 3 5 4 2 3 2 4
+#> [1] 2 5 2 2 1 3 2 3 2 2
rxpois(lambda = 3, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 3 3 1 2 4 4 1 2 7 1
+#> [1] 1 2 4 2 5 0 1 3 3 3
rxpois(4) ## The first arguments are the lambda parameter
-#> [1] 4
+#> [1] 5
## This example uses `rxpois` directly in the model
diff --git a/reference/rxt.html b/reference/rxt.html
index 03dd78f42..fdf36db50 100644
--- a/reference/rxt.html
+++ b/reference/rxt.html
@@ -198,14 +198,14 @@ Examples
## Use threefry engine
rxt(df = 3, n = 10) # with rxt you have to explicitly state n
-#> [1] -1.18148834 -0.06646377 -1.57446744 -0.33784956 -0.72437388 0.09331274
-#> [7] -0.84273603 -1.26466847 0.55132509 1.42084910
+#> [1] 0.3757489 -1.0929198 0.4496582 -0.7100168 4.0821279 0.1564602
+#> [7] -2.3129516 0.9455909 -1.3950564 -1.0967017
rxt(df = 3, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] -2.1534885 -1.2935224 -0.1421191 -0.4395098 -0.9433403 0.8660087
-#> [7] -0.6156332 -0.7324325 0.2463557 2.0830450
+#> [1] -0.09560338 2.30004650 -0.44279496 0.40352877 -0.06773039 0.84341867
+#> [7] -0.51744228 -1.88729910 -1.65975277 0.87533914
rxt(4) ## The first argument is the df parameter
-#> [1] 0.9491927
+#> [1] 0.1890926
## This example uses `rxt` directly in the model
diff --git a/reference/rxunif.html b/reference/rxunif.html
index 5e7a93572..55053a897 100644
--- a/reference/rxunif.html
+++ b/reference/rxunif.html
@@ -198,14 +198,14 @@ Examples## Use threefry engine
rxunif(min = 0, max = 4, n = 10) # with rxunif you have to explicitly state n
-#> [1] 2.83621223 1.96992696 3.10756061 1.95011275 2.95676211 3.12595909
-#> [7] 1.90003174 0.06671147 3.94480453 2.89367047
+#> [1] 8.372550e-01 3.583999e+00 2.408055e+00 6.399907e-01 2.294921e-02
+#> [6] 2.839426e+00 6.982711e-05 2.993348e+00 2.264349e+00 1.249635e+00
rxunif(min = 0, max = 4, n = 10, ncores = 2) # You can parallelize the simulation using openMP
-#> [1] 1.870415 2.409909 1.118098 3.214835 3.739250 2.834278 1.476741 3.726650
-#> [9] 1.077344 3.716599
+#> [1] 2.4039488 0.3410682 0.5535628 2.2799663 0.5887105 2.6540469 2.3969818
+#> [8] 2.2524206 3.7296385 3.7817212
rxunif()
-#> [1] 0.6237814
+#> [1] 0.7661502
## This example uses `rxunif` directly in the model
diff --git a/reference/rxweibull.html b/reference/rxweibull.html
index 965d1ef05..8def44e7b 100644
--- a/reference/rxweibull.html
+++ b/reference/rxweibull.html
@@ -199,16 +199,16 @@ Examples
# with rxweibull you have to explicitly state n
rxweibull(shape = 1, scale = 4, n = 10)
-#> [1] 0.2880067 9.6733848 10.0625276 5.2121465 0.1162208 1.7431259
-#> [7] 0.5911653 2.5184338 16.9541216 0.2694327
+#> [1] 0.3874992 3.1784742 0.3866576 0.4752647 11.6122071 5.2736322
+#> [7] 4.8772255 0.7743957 3.6822614 3.1735263
# You can parallelize the simulation using openMP
rxweibull(shape = 1, scale = 4, n = 10, ncores = 2)
-#> [1] 2.3887151 12.8395182 2.4934963 3.5757075 3.2911726 0.8062004
-#> [7] 6.4677394 7.9369076 4.6097734 0.4939880
+#> [1] 0.4541006 8.0030203 3.8028113 4.6215899 0.1147611 0.1336322 0.2441735
+#> [8] 1.8856361 4.7262429 7.3846402
rxweibull(3)
-#> [1] 0.4003905
+#> [1] 0.5283103
## This example uses `rxweibull` directly in the model
diff --git a/reference/stat_amt-1.png b/reference/stat_amt-1.png
index c7e42cfe0..7e7bb0513 100644
Binary files a/reference/stat_amt-1.png and b/reference/stat_amt-1.png differ
diff --git a/reference/stat_amt-2.png b/reference/stat_amt-2.png
index 1096dcf50..2a8021e32 100644
Binary files a/reference/stat_amt-2.png and b/reference/stat_amt-2.png differ
diff --git a/search.json b/search.json
index c1812a91c..766cfe14c 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"user-defined-functions","dir":"Articles","previous_headings":"","what":"User Defined Functions","title":"Integrating User Defined Functions into rxode2","text":"defining models may wished write small R function make function integrate rxode2 somehow. article discusses 2 ways : R-based user function can loaded simple function certain circumstances translated C run efficiently C function define integrate code","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()`"},{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"r-based-user-functions","dir":"Articles","previous_headings":"","what":"R based user functions","title":"Integrating User Defined Functions into rxode2","text":"R-based user function convenient include ODE, slower done written C , C++ compiled language. requested github appropriate example; However, use simple example simply illustrate concepts. Now ODE compiled R functions called solving ODE. Since calling R, forces parallization turned since R single-threaded. also takes time solve since shuttling back forth R C. Lets see simple function performs: terribly bad, even though shuffling R C. can make better converting functions C: C version almost twice fast R version. may noticed conversion also created C versions first derivative. done automatically gives just C versions function, C versions derivatives registers rxode2. allows C versions work rxode2 nlmixr2 models. function setup advance allow type conversion. general derivatives calculated return() statement user defined function. means simply let R return last value instead explictly calling return(). Many people prefer method coding. Even return function, function converted C. github issue, used function convert derivatives: still helpful functions early returns, nlmixr2 models requiring derivatives calculated non-optimized finite differences occurs. gets internals rxode2 nlmixr2 can see easily calculating derivatives: Whereas originally defined function newAbs() use new derivatives calculated well: circumstances, conversion C possible, though can still use R function. requirements R functions integrated rxode2 system: function must set number arguments, variable arguments like f(…) currently allowed. function given argument single number, function return single number requirements met can use R function rxode2. Additional requirements conversion C include: functions use within R function must understood available rxode2. Practically speaking fun2() refers fun1(), fun1() must changed C code available rxode2 changing function fun2() C. functions can include /else assignments simple return statements (either returning value value line ). Special R control structures functions (like lapply) present. function refer package functions mentioned, return() statement present, derivative C functions rxode2’s derivative table updated.","code":"newAbs <- function(x) { if (x < 0) { -x } else { x } } f <- rxode2({ a <- newAbs(time) }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ e <- et(-10, 10, length.out=40) mb1 <- microbenchmark::microbenchmark(withoutC=suppressWarnings(rxSolve(f,e))) library(ggplot2) autoplot(mb1) + rxTheme() # Create C functions automatically with `rxFun()` rxFun(newAbs) #> → finding duplicate expressions in d(newAbs)/d(x)... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in d(newAbs)/d(x)... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> converted R function 'newAbs' to C (will now use in rxode2) #> converted R function 'rx_newAbs_d_x' to C (will now use in rxode2) #> Added derivative table for 'newAbs' # Recompile to use the C functions # Note it would recompile anyway if you didn't do this step, # it just makes sure that it doesn't recompile every step in # the benchmark f <- rxode2({ a <- newAbs(time) }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ mb2 <- microbenchmark::microbenchmark(withC=rxSolve(f,e, cores=1)) mb <- rbind(mb1, mb2) autoplot(mb) + rxTheme() + xgxr::xgx_scale_y_log10() #> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale. print(mb) #> Unit: milliseconds #> expr min lq mean median uq max neval #> withoutC 7.756175 7.847705 8.458881 7.914530 8.094942 13.65840 100 #> withC 2.089166 2.133058 2.486548 2.254109 2.774495 6.45083 100 # Light f_R <- function(actRad, k_0, a_k) { photfac <- a_k * actRad + k_0 if (photfac > 1) { photfac = 1 } return(photfac) } rxFun(f_R) #> function contains return statement; derivatives not calculated #> converted R function 'f_R' to C (will now use in rxode2) rxFromSE(\"Derivative(f_R(actRad, k_0, a_k),k_0)\") #> [1] \"(f_R(actRad,(k_0)+6.05545445239334e-06,a_k)-f_R(actRad,k_0,a_k))/6.05545445239334e-06\" rxFromSE(\"Derivative(newAbs(x),x)\") #> [1] \"rx_newAbs_d_x(x)\""},{"path":"https://nlmixr2.github.io/rxode2/articles/Integrating-User-Defined-Functions-into-rxode2.html","id":"c-based-functions","dir":"Articles","previous_headings":"","what":"C based functions","title":"Integrating User Defined Functions into rxode2","text":"can add C functions directly rxode2 well using rxFun(): wanted also use C functions expressions derivatives using rxD() function: Removing function rxRmFun() also remove derivative table:","code":"fun <- \" double fun(double a, double b, double c) { return a*a+b*a+c; } \" ## C-code for function rxFun(\"fun\", c(\"a\", \"b\", \"c\"), fun) rxD(\"fun\", list( function(a, b, c) { # derivative of arg1: a paste0(\"2*\", a, \"+\", b) }, function(a, b, c) { # derivative of arg2: b return(a) }, function(a, b, c) { # derivative of arg3: c return(\"0.0\") } )) rxRmFun(\"fun\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"how-rxode2-assigns-compartment-numbers","dir":"Articles","previous_headings":"","what":"How rxode2 assigns compartment numbers","title":"Changing rxode2 compartment numbers","text":"rxode2 automatically assigns compartment numbers parsing. example, Mavoglurant PBPK model following model may used: look printout, can see rxode2 assigned compartment number(s) can also see classic rxode2 model. case use summary() function: case, Venous_Blood assigned compartment 15. Figuring can inconvenient also lead re-numbering compartment simulation estimation datasets. easy probably clearer specify compartment name, tools support compartment numbers. Therefore, way number compartment easily can lead less data modification multiple tools.","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` pbpk <- function() { model({ KbBR = exp(lKbBR) KbMU = exp(lKbMU) KbAD = exp(lKbAD) CLint= exp(lCLint + eta.LClint) KbBO = exp(lKbBO) KbRB = exp(lKbRB) ## Regional blood flows # Cardiac output (L/h) from White et al (1968) CO = (187.00*WT^0.81)*60/1000 QHT = 4.0 *CO/100 QBR = 12.0*CO/100 QMU = 17.0*CO/100 QAD = 5.0 *CO/100 QSK = 5.0 *CO/100 QSP = 3.0 *CO/100 QPA = 1.0 *CO/100 QLI = 25.5*CO/100 QST = 1.0 *CO/100 QGU = 14.0*CO/100 # Hepatic artery blood flow QHA = QLI - (QSP + QPA + QST + QGU) QBO = 5.0 *CO/100 QKI = 19.0*CO/100 QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI) QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB ## Organs' volumes = organs' weights / organs' density VLU = (0.76 *WT/100)/1.051 VHT = (0.47 *WT/100)/1.030 VBR = (2.00 *WT/100)/1.036 VMU = (40.00*WT/100)/1.041 VAD = (21.42*WT/100)/0.916 VSK = (3.71 *WT/100)/1.116 VSP = (0.26 *WT/100)/1.054 VPA = (0.14 *WT/100)/1.045 VLI = (2.57 *WT/100)/1.040 VST = (0.21 *WT/100)/1.050 VGU = (1.44 *WT/100)/1.043 VBO = (14.29*WT/100)/1.990 VKI = (0.44 *WT/100)/1.050 VAB = (2.81 *WT/100)/1.040 VVB = (5.62 *WT/100)/1.040 VRB = (3.86 *WT/100)/1.040 ## Fixed parameters BP = 0.61 # Blood:plasma partition coefficient fup = 0.028 # Fraction unbound in plasma fub = fup/BP # Fraction unbound in blood KbLU = exp(0.8334) KbHT = exp(1.1205) KbSK = exp(-.5238) KbSP = exp(0.3224) KbPA = exp(0.3224) KbLI = exp(1.7604) KbST = exp(0.3224) KbGU = exp(1.2026) KbKI = exp(1.3171) ##----------------------------------------- S15 = VVB*BP/1000 C15 = Venous_Blood/S15 ##----------------------------------------- d/dt(Lungs) = QLU*(Venous_Blood/VVB - Lungs/KbLU/VLU) d/dt(Heart) = QHT*(Arterial_Blood/VAB - Heart/KbHT/VHT) d/dt(Brain) = QBR*(Arterial_Blood/VAB - Brain/KbBR/VBR) d/dt(Muscles) = QMU*(Arterial_Blood/VAB - Muscles/KbMU/VMU) d/dt(Adipose) = QAD*(Arterial_Blood/VAB - Adipose/KbAD/VAD) d/dt(Skin) = QSK*(Arterial_Blood/VAB - Skin/KbSK/VSK) d/dt(Spleen) = QSP*(Arterial_Blood/VAB - Spleen/KbSP/VSP) d/dt(Pancreas) = QPA*(Arterial_Blood/VAB - Pancreas/KbPA/VPA) d/dt(Liver) = QHA*Arterial_Blood/VAB + QSP*Spleen/KbSP/VSP + QPA*Pancreas/KbPA/VPA + QST*Stomach/KbST/VST + QGU*Gut/KbGU/VGU - CLint*fub*Liver/KbLI/VLI - QLI*Liver/KbLI/VLI d/dt(Stomach) = QST*(Arterial_Blood/VAB - Stomach/KbST/VST) d/dt(Gut) = QGU*(Arterial_Blood/VAB - Gut/KbGU/VGU) d/dt(Bones) = QBO*(Arterial_Blood/VAB - Bones/KbBO/VBO) d/dt(Kidneys) = QKI*(Arterial_Blood/VAB - Kidneys/KbKI/VKI) d/dt(Arterial_Blood) = QLU*(Lungs/KbLU/VLU - Arterial_Blood/VAB) d/dt(Venous_Blood) = QHT*Heart/KbHT/VHT + QBR*Brain/KbBR/VBR + QMU*Muscles/KbMU/VMU + QAD*Adipose/KbAD/VAD + QSK*Skin/KbSK/VSK + QLI*Liver/KbLI/VLI + QBO*Bones/KbBO/VBO + QKI*Kidneys/KbKI/VKI + QRB*Rest_of_Body/KbRB/VRB - QLU*Venous_Blood/VVB d/dt(Rest_of_Body) = QRB*(Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) }) } pbpk <- pbpk() print(pbpk) #> -- rxode2-based free-form 16-cmt ODE model ------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 Lungs #> 2 2 Heart #> 3 3 Brain #> 4 4 Muscles #> 5 5 Adipose #> 6 6 Skin #> 7 7 Spleen #> 8 8 Pancreas #> 9 9 Liver #> 10 10 Stomach #> 11 11 Gut #> 12 12 Bones #> 13 13 Kidneys #> 14 14 Arterial_Blood #> 15 15 Venous_Blood #> 16 16 Rest_of_Body #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + #> QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + #> QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + #> QGU * Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - #> QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + #> QSK * Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * #> Bones/KbBO/VBO + QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> }) #> } pbpk <- pbpk$simulationModel #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ summary(pbpk) #> rxode2 2.0.14.9000 model named rx_7ecfe139441efa7d6685fa89a52fedb8 model (ready). #> DLL: /tmp/RtmprYXrJy/rxode2/rx_7ecfe139441efa7d6685fa89a52fedb8__.rxd/rx_7ecfe139441efa7d6685fa89a52fedb8_.so #> NULL #> #> Calculated Variables: #> [1] \"KbBR\" \"KbMU\" \"KbAD\" \"CLint\" \"KbBO\" \"KbRB\" \"CO\" \"QHT\" \"QBR\" #> [10] \"QMU\" \"QAD\" \"QSK\" \"QSP\" \"QPA\" \"QLI\" \"QST\" \"QGU\" \"QHA\" #> [19] \"QBO\" \"QKI\" \"QRB\" \"QLU\" \"VLU\" \"VHT\" \"VBR\" \"VMU\" \"VAD\" #> [28] \"VSK\" \"VSP\" \"VPA\" \"VLI\" \"VST\" \"VGU\" \"VBO\" \"VKI\" \"VAB\" #> [37] \"VVB\" \"VRB\" \"fub\" \"KbLU\" \"KbHT\" \"KbSK\" \"KbSP\" \"KbPA\" \"KbLI\" #> [46] \"KbST\" \"KbGU\" \"KbKI\" \"S15\" \"C15\" #> -- rxode2 Model Syntax -- #> rxode2({ #> param(lKbBR, lKbMU, lKbAD, lCLint, eta.LClint, lKbBO, lKbRB, #> WT) #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + QGU * #> Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + QSK * #> Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * Bones/KbBO/VBO + #> QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> })"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"changing-compartment-numbers-by-pre-declaring-the-compartments","dir":"Articles","previous_headings":"","what":"Changing compartment numbers by pre-declaring the compartments","title":"Changing rxode2 compartment numbers","text":"add compartments rxode2 model order desire simply need pre-declare compartments cmt. example specifying Venous_Blood Skin 1st 2nd compartments, respectively, simple: can see change simple printout first two compartments Venous_Blood followed Skin.","code":"pbpk2 <- function() { model({ ## Now this is the first compartment, ie cmt=1 cmt(Venous_Blood) ## Skin may be a compartment you wish to dose to as well, ## so it is now cmt=2 cmt(Skin) KbBR = exp(lKbBR) KbMU = exp(lKbMU) KbAD = exp(lKbAD) CLint= exp(lCLint + eta.LClint) KbBO = exp(lKbBO) KbRB = exp(lKbRB) ## Regional blood flows # Cardiac output (L/h) from White et al (1968)m CO = (187.00*WT^0.81)*60/1000; QHT = 4.0 *CO/100; QBR = 12.0*CO/100; QMU = 17.0*CO/100; QAD = 5.0 *CO/100; QSK = 5.0 *CO/100; QSP = 3.0 *CO/100; QPA = 1.0 *CO/100; QLI = 25.5*CO/100; QST = 1.0 *CO/100; QGU = 14.0*CO/100; QHA = QLI - (QSP + QPA + QST + QGU); # Hepatic artery blood flow QBO = 5.0 *CO/100; QKI = 19.0*CO/100; QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI); QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + QRB; ## Organs' volumes = organs' weights / organs' density VLU = (0.76 *WT/100)/1.051; VHT = (0.47 *WT/100)/1.030; VBR = (2.00 *WT/100)/1.036; VMU = (40.00*WT/100)/1.041; VAD = (21.42*WT/100)/0.916; VSK = (3.71 *WT/100)/1.116; VSP = (0.26 *WT/100)/1.054; VPA = (0.14 *WT/100)/1.045; VLI = (2.57 *WT/100)/1.040; VST = (0.21 *WT/100)/1.050; VGU = (1.44 *WT/100)/1.043; VBO = (14.29*WT/100)/1.990; VKI = (0.44 *WT/100)/1.050; VAB = (2.81 *WT/100)/1.040; VVB = (5.62 *WT/100)/1.040; VRB = (3.86 *WT/100)/1.040; ## Fixed parameters BP = 0.61; # Blood:plasma partition coefficient fup = 0.028; # Fraction unbound in plasma fub = fup/BP; # Fraction unbound in blood KbLU = exp(0.8334); KbHT = exp(1.1205); KbSK = exp(-.5238); KbSP = exp(0.3224); KbPA = exp(0.3224); KbLI = exp(1.7604); KbST = exp(0.3224); KbGU = exp(1.2026); KbKI = exp(1.3171); ##----------------------------------------- S15 = VVB*BP/1000; C15 = Venous_Blood/S15 ##----------------------------------------- d/dt(Lungs) = QLU*(Venous_Blood/VVB - Lungs/KbLU/VLU); d/dt(Heart) = QHT*(Arterial_Blood/VAB - Heart/KbHT/VHT); d/dt(Brain) = QBR*(Arterial_Blood/VAB - Brain/KbBR/VBR); d/dt(Muscles) = QMU*(Arterial_Blood/VAB - Muscles/KbMU/VMU); d/dt(Adipose) = QAD*(Arterial_Blood/VAB - Adipose/KbAD/VAD); d/dt(Skin) = QSK*(Arterial_Blood/VAB - Skin/KbSK/VSK); d/dt(Spleen) = QSP*(Arterial_Blood/VAB - Spleen/KbSP/VSP); d/dt(Pancreas) = QPA*(Arterial_Blood/VAB - Pancreas/KbPA/VPA); d/dt(Liver) = QHA*Arterial_Blood/VAB + QSP*Spleen/KbSP/VSP + QPA*Pancreas/KbPA/VPA + QST*Stomach/KbST/VST + QGU*Gut/KbGU/VGU - CLint*fub*Liver/KbLI/VLI - QLI*Liver/KbLI/VLI; d/dt(Stomach) = QST*(Arterial_Blood/VAB - Stomach/KbST/VST); d/dt(Gut) = QGU*(Arterial_Blood/VAB - Gut/KbGU/VGU); d/dt(Bones) = QBO*(Arterial_Blood/VAB - Bones/KbBO/VBO); d/dt(Kidneys) = QKI*(Arterial_Blood/VAB - Kidneys/KbKI/VKI); d/dt(Arterial_Blood) = QLU*(Lungs/KbLU/VLU - Arterial_Blood/VAB); d/dt(Venous_Blood) = QHT*Heart/KbHT/VHT + QBR*Brain/KbBR/VBR + QMU*Muscles/KbMU/VMU + QAD*Adipose/KbAD/VAD + QSK*Skin/KbSK/VSK + QLI*Liver/KbLI/VLI + QBO*Bones/KbBO/VBO + QKI*Kidneys/KbKI/VKI + QRB*Rest_of_Body/KbRB/VRB - QLU*Venous_Blood/VVB; d/dt(Rest_of_Body) = QRB*(Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB); }) } pbpk2 <- pbpk2() pbpk2 #> -- rxode2-based free-form 16-cmt ODE model ------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 Venous_Blood #> 2 2 Skin #> 3 3 Lungs #> 4 4 Heart #> 5 5 Brain #> 6 6 Muscles #> 7 7 Adipose #> 8 8 Spleen #> 9 9 Pancreas #> 10 10 Liver #> 11 11 Stomach #> 12 12 Gut #> 13 13 Bones #> 14 14 Kidneys #> 15 15 Arterial_Blood #> 16 16 Rest_of_Body #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> cmt(Venous_Blood) #> cmt(Skin) #> KbBR = exp(lKbBR) #> KbMU = exp(lKbMU) #> KbAD = exp(lKbAD) #> CLint = exp(lCLint + eta.LClint) #> KbBO = exp(lKbBO) #> KbRB = exp(lKbRB) #> CO = (187 * WT^0.81) * 60/1000 #> QHT = 4 * CO/100 #> QBR = 12 * CO/100 #> QMU = 17 * CO/100 #> QAD = 5 * CO/100 #> QSK = 5 * CO/100 #> QSP = 3 * CO/100 #> QPA = 1 * CO/100 #> QLI = 25.5 * CO/100 #> QST = 1 * CO/100 #> QGU = 14 * CO/100 #> QHA = QLI - (QSP + QPA + QST + QGU) #> QBO = 5 * CO/100 #> QKI = 19 * CO/100 #> QRB = CO - (QHT + QBR + QMU + QAD + QSK + QLI + QBO + #> QKI) #> QLU = QHT + QBR + QMU + QAD + QSK + QLI + QBO + QKI + #> QRB #> VLU = (0.76 * WT/100)/1.051 #> VHT = (0.47 * WT/100)/1.03 #> VBR = (2 * WT/100)/1.036 #> VMU = (40 * WT/100)/1.041 #> VAD = (21.42 * WT/100)/0.916 #> VSK = (3.71 * WT/100)/1.116 #> VSP = (0.26 * WT/100)/1.054 #> VPA = (0.14 * WT/100)/1.045 #> VLI = (2.57 * WT/100)/1.04 #> VST = (0.21 * WT/100)/1.05 #> VGU = (1.44 * WT/100)/1.043 #> VBO = (14.29 * WT/100)/1.99 #> VKI = (0.44 * WT/100)/1.05 #> VAB = (2.81 * WT/100)/1.04 #> VVB = (5.62 * WT/100)/1.04 #> VRB = (3.86 * WT/100)/1.04 #> BP = 0.61 #> fup = 0.028 #> fub = fup/BP #> KbLU = exp(0.8334) #> KbHT = exp(1.1205) #> KbSK = exp(-0.5238) #> KbSP = exp(0.3224) #> KbPA = exp(0.3224) #> KbLI = exp(1.7604) #> KbST = exp(0.3224) #> KbGU = exp(1.2026) #> KbKI = exp(1.3171) #> S15 = VVB * BP/1000 #> C15 = Venous_Blood/S15 #> d/dt(Lungs) = QLU * (Venous_Blood/VVB - Lungs/KbLU/VLU) #> d/dt(Heart) = QHT * (Arterial_Blood/VAB - Heart/KbHT/VHT) #> d/dt(Brain) = QBR * (Arterial_Blood/VAB - Brain/KbBR/VBR) #> d/dt(Muscles) = QMU * (Arterial_Blood/VAB - Muscles/KbMU/VMU) #> d/dt(Adipose) = QAD * (Arterial_Blood/VAB - Adipose/KbAD/VAD) #> d/dt(Skin) = QSK * (Arterial_Blood/VAB - Skin/KbSK/VSK) #> d/dt(Spleen) = QSP * (Arterial_Blood/VAB - Spleen/KbSP/VSP) #> d/dt(Pancreas) = QPA * (Arterial_Blood/VAB - Pancreas/KbPA/VPA) #> d/dt(Liver) = QHA * Arterial_Blood/VAB + QSP * Spleen/KbSP/VSP + #> QPA * Pancreas/KbPA/VPA + QST * Stomach/KbST/VST + #> QGU * Gut/KbGU/VGU - CLint * fub * Liver/KbLI/VLI - #> QLI * Liver/KbLI/VLI #> d/dt(Stomach) = QST * (Arterial_Blood/VAB - Stomach/KbST/VST) #> d/dt(Gut) = QGU * (Arterial_Blood/VAB - Gut/KbGU/VGU) #> d/dt(Bones) = QBO * (Arterial_Blood/VAB - Bones/KbBO/VBO) #> d/dt(Kidneys) = QKI * (Arterial_Blood/VAB - Kidneys/KbKI/VKI) #> d/dt(Arterial_Blood) = QLU * (Lungs/KbLU/VLU - Arterial_Blood/VAB) #> d/dt(Venous_Blood) = QHT * Heart/KbHT/VHT + QBR * Brain/KbBR/VBR + #> QMU * Muscles/KbMU/VMU + QAD * Adipose/KbAD/VAD + #> QSK * Skin/KbSK/VSK + QLI * Liver/KbLI/VLI + QBO * #> Bones/KbBO/VBO + QKI * Kidneys/KbKI/VKI + QRB * Rest_of_Body/KbRB/VRB - #> QLU * Venous_Blood/VVB #> d/dt(Rest_of_Body) = QRB * (Arterial_Blood/VAB - Rest_of_Body/KbRB/VRB) #> }) #> }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-cmt.html","id":"appending-compartments-to-the-model","dir":"Articles","previous_headings":"","what":"Appending compartments to the model","title":"Changing rxode2 compartment numbers","text":"can also append “compartments” model. ODE solving internals, add fake compartments model differential equations defined. example legal: can see clearly underlying classic rxode2 model: compartments defined differential equations supported; model : give error:","code":"ode.1c.ka <- function(){ model({ C2 = center/V d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 cmt(eff) }) } ode.1c.ka <- ode.1c.ka() print(ode.1c.ka) #> -- rxode2-based free-form 2-cmt ODE model -------------------------------------- #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 center #> -- Model (Normalized Syntax): -- #> function() { #> model({ #> C2 = center/V #> d/dt(depot) = -KA * depot #> d/dt(center) = KA * depot - CL * C2 #> cmt(eff) #> }) #> } ode.1c.ka$simulationModel #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> rxode2 2.0.14.9000 model named rx_4851cdb3054ffc2f3e5f53f3896aac57 model (ready). #> x$state: depot, center #> x$stateExtra: eff #> x$params: V, KA, CL #> x$lhs: C2 ode.1c.ka <- rxode2({ cmt(eff) C2 = center/V; d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 }) Error in rxModelVars_(obj) : Evaluation error: Compartment 'eff' needs differential equations defined."},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-covariates.html","id":"individual-covariates","dir":"Articles","previous_headings":"","what":"Individual Covariates","title":"rxode2 Covariates","text":"individual covariate wish solve may specify iCov dataset:","code":"library(rxode2) ## rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) ## no cache: create with `rxCreateCache()` library(units) ## udunits database from /usr/share/xml/udunits/udunits2.xml library(xgxr) mod3 <- function() { ini({ TKA <- 2.94E-01 ## Clearance with individuals TCL <- 1.86E+01 TV2 <-4.02E+01 TQ <-1.05E+01 TV3 <-2.97E+02 TKin <- 1 TKout <- 1 TEC50 <-200 }) model({ KA <- TKA CL <- TCL * (WT / 70) ^ 0.75 V2 <- TV2 Q <- TQ V3 <- TV3 Kin <- TKin Kout <- TKout EC50 <- TEC50 Tz <- 8 amp <- 0.1 C2 <- central/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(central) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 ## This specifies that the effect compartment starts at 1. }) } ev <- et(amount.units=\"mg\", time.units=\"hours\") %>% et(amt=10000, cmt=1) %>% et(0,48,length.out=100) %>% et(id=1:4) set.seed(10) rxSetSeed(10) ## Now use iCov to simulate a 4-id sample r1 <- solve(mod3, ev, # Create individual covariate data-frame iCov=data.frame(id=1:4, WT=rnorm(4, 70, 10))) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ print(r1) ## ── Solved rxode2 object ── ## ── Parameters ($params): ── ## TKA TCL TV2 TQ TV3 TKin TKout TEC50 Tz amp ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 8.000 0.100 ## ── Initial Conditions ($inits): ── ## depot central peri eff ## 0 0 0 1 ## ── First part of data (object): ── ## # A tibble: 400 × 17 ## id time KA CL V2 Q V3 Kin Kout EC50 C2 C3 depot ## [h] ## 1 1 0 0.294 18.6 40.2 10.5 297 1 1 200 0 0 10000 ## 2 1 0.485 0.294 18.6 40.2 10.5 297 1 1 200 27.8 0.257 8671. ## 3 1 0.970 0.294 18.6 40.2 10.5 297 1 1 200 43.7 0.873 7519. ## 4 1 1.45 0.294 18.6 40.2 10.5 297 1 1 200 51.7 1.68 6520. ## 5 1 1.94 0.294 18.6 40.2 10.5 297 1 1 200 54.7 2.56 5654. ## 6 1 2.42 0.294 18.6 40.2 10.5 297 1 1 200 54.5 3.45 4903. ## # ℹ 394 more rows ## # ℹ 4 more variables: central , peri , eff , WT plot(r1, C2, log=\"y\") ## Warning: Transformation introduced infinite values in continuous y-axis"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-covariates.html","id":"time-varying-covariates","dir":"Articles","previous_headings":"","what":"Time Varying Covariates","title":"rxode2 Covariates","text":"Covariates easy specify rxode2, can specify variable. Time-varying covariates, like clock time circadian rhythm model, can also used. Extending indirect response model already discussed, : Now covariate present event dataset, system can solved combining dataset model: solving ODE equations, solver may sample times outside data. happens, ODE solver can use linear interpolation covariate values. equivalent R’s approxfun method=\"linear\". Note linear approximation case leads kinks solved system 24-hours covariate linear interpolation near 24 near 0. linear seems reasonable, cases like clock time make interpolation methods attractive. rxode2 default covariate interpolation last observation carried forward (locf), constant approximation. equivalent R’s approxfun method=\"constant\". gives following plots: case, plots seem smoother. can also use NONMEM’s preferred interpolation style next observation carried backward (NOCB): gives following plots:","code":"library(rxode2) library(units) mod4 <- mod3 %>% model(d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff) %>% model(-Kin) %>% model(Kin <- TKin + amp *cos(2*pi*(ctime-Tz)/24), append=C2, cov=\"ctime\") ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, cmt=1) %>% et(0,48,length.out=100) ## Create data frame of 8 am dosing for the first dose This is done ## with base R but it can be done with dplyr or data.table ev$ctime <- (ev$time+set_units(8,hr)) %% 24 ev$WT <- 70 r1 <- solve(mod4, ev, covsInterpolation=\"linear\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\") plot(r1,eff) + ylab(\"Effect\") + xlab(\"Time\") r1 <- solve(mod4, ev,covsInterpolation=\"locf\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\", xlab=\"Time\") plot(r1,eff, ylab=\"Effect\", xlab=\"Time\") r1 <- solve(mod4, ev,covsInterpolation=\"nocb\") print(r1) #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> TKA TCL TV2 TQ TV3 TKout TEC50 #> 0.294000 18.600000 40.200000 10.500000 297.000000 1.000000 200.000000 #> TKin Tz amp pi #> 1.000000 8.000000 0.100000 3.141593 #> ── Initial Conditions ($inits): ── #> depot central peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 100 × 17 #> time KA CL V2 Q V3 Kout EC50 C2 Kin C3 depot #> [h] #> 1 0 0.294 18.6 40.2 10.5 297 1 200 0 1.1 0 10000 #> 2 0.485 0.294 18.6 40.2 10.5 297 1 200 27.8 1.10 0.257 8671. #> 3 0.970 0.294 18.6 40.2 10.5 297 1 200 43.7 1.10 0.874 7519. #> 4 1.45 0.294 18.6 40.2 10.5 297 1 200 51.8 1.09 1.68 6520. #> 5 1.94 0.294 18.6 40.2 10.5 297 1 200 54.8 1.09 2.56 5654. #> 6 2.42 0.294 18.6 40.2 10.5 297 1 200 54.6 1.08 3.45 4903. #> # ℹ 94 more rows #> # ℹ 5 more variables: central , peri , eff , ctime [h], WT plot(r1,C2, ylab=\"Central Concentration\", xlab=\"Time\") plot(r1,eff, ylab=\"Effect\", xlab=\"Time\")"},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"creating-an-interactive-data-frame","dir":"Articles","previous_headings":"Using rxode2 data frames","what":"Creating an interactive data frame","title":"rxode2 Data Frames","text":"rxode2 supports returning solved object modified data-frame. done predict(), solve(), rxSolve() methods.","code":"library(rxode2) library(units) ## Setup example model mod1 <- function() { ini({ # central KA <- 2.94E-01 CL <- 1.86E+01 # peripheral V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 # effects Kin <- 1 Kout <- 1 EC50 <- 200 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 }) } ## Seup parameters and initial conditions ## Setup dosing event information ev <- et(amountUnits=\"mg\", timeUnits = \"hours\") %>% et(amt=10000, addl=9, ii=12) %>% et(amt=20000, addl=4, time=120, ii=24) %>% et(0:240) ## Now solve x <- predict(mod1, ev) x #> -- Solved rxode2 object -- #> -- Parameters (x$params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions (x$inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 241 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # i 235 more rows"},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"using-the-solved-object-as-a-simple-data-frame","dir":"Articles","previous_headings":"Using rxode2 data frames","what":"Using the solved object as a simple data frame","title":"rxode2 Data Frames","text":"solved object acts data.frame tbl can filtered dpylr. example filter easily.","code":"library(dplyr) ## You can drop units for comparisons and filtering x <- mod1 %>% solve(ev) %>% drop_units() %>% filter(time <= 3) %>% as_tibble() ## or keep them and compare with the proper units. x <- mod1 %>% solve(ev) %>% filter(time <= set_units(3, hr)) %>% as_tibble() x #> # A tibble: 4 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"updating-the-data-set-interactively","dir":"Articles","previous_headings":"","what":"Updating the data-set interactively","title":"rxode2 Data Frames","text":"However isn’t just simple data object. can use solved object update parameters fly, even change sampling time. First need recreate original solved system:","code":"x <- mod1 %>% solve(ev) print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 241 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # i 235 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"modifying-observation-times-for-rxode2","dir":"Articles","previous_headings":"Updating the data-set interactively","what":"Modifying observation times for rxode2","title":"rxode2 Data Frames","text":"Notice initial effect now 2. can also change sampling times easily method changing t time. example:","code":"x$t <- seq(0,5,length.out=20) print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 20 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 0.263 16.8 0.0817 9255. 677. 24.3 1.01 #> 3 0.526 29.5 0.299 8566. 1187. 88.7 1.03 #> 4 0.789 38.9 0.615 7929. 1562. 183. 1.06 #> 5 1.05 45.5 1.00 7338. 1830. 298. 1.09 #> 6 1.32 50.1 1.44 6792. 2013. 427. 1.12 #> # i 14 more rows plot(x)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-data-frame.html","id":"modifying-simulation-parameters","dir":"Articles","previous_headings":"Updating the data-set interactively","what":"Modifying simulation parameters","title":"rxode2 Data Frames","text":"can also access change parameters $ operator. example, accessing KA can done : may change assigning new value. can access/change parameters, initialization(s) events $params, $inits, $events accessor syntax, similar used . syntax makes easy update explore effect various parameters solved object.","code":"x$KA #> [1] 0.294 x$KA <- 1 print(x) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> KA CL V2 Q V3 Kin Kout EC50 #> 1.0 18.6 40.2 10.5 297.0 1.0 1.0 200.0 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> -- First part of data (object): -- #> # A tibble: 20 x 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 0.263 52.2 0.261 7686. 2098. 77.6 1.03 #> 3 0.526 83.3 0.900 5908. 3348. 267. 1.09 #> 4 0.789 99.8 1.75 4541. 4010. 519. 1.15 #> 5 1.05 106. 2.69 3490. 4273. 800. 1.21 #> 6 1.32 106. 3.66 2683. 4272. 1086. 1.26 #> # i 14 more rows plot(x)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"datasets-for-rxode2-nlmixr","dir":"Articles","previous_headings":"","what":"Datasets for rxode2 & nlmixr","title":"rxode2 Event Types","text":"Data input nlmixr type data input rxode2, similar data NONMEM (NONMEM-ready datasets can used directly nlmixr).","code":""},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"subject-identification-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Subject Identification Columns","title":"rxode2 Event Types","text":"subject identification column separates subjects identification random effects. ID: subject identifier may integer, character, factor.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"observation-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Observation Columns","title":"rxode2 Event Types","text":"Observation columns used indicate dependent variable use measure . DV: numeric column measurement CENS: numeric column indication censoring, limit quantification assay. LIMIT: numeric column helping indicate type censoring, limit quantification assay. MDV: indicator missing DV values CMT: name number compartment DVID: dependent variable identifier EVID event identifier","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dosing-columns","dir":"Articles","previous_headings":"Columns Described by Type of Use","what":"Dosing Columns","title":"rxode2 Event Types","text":"AMT: amount dose CMT: name number compartment EVID: event identifier ADDL: number additional doses RATE DUR: rate duration dose","code":""},{"path":[]},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"details-for-specific-dataset-columns","dir":"Articles","previous_headings":"","what":"Details for Specific Dataset Columns","title":"rxode2 Event Types","text":"details sorted alphabetically column name. grouping use, see documentation .","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"amt-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"AMT Column","title":"rxode2 Event Types","text":"AMT column defines amount dose. observation rows, 0 NA. dosing rows, amount dose administered CMT. dose zero-order rate (constant infusion), infusion may setup using RATE DUR column.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"censlimit-columns","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"CENS/LIMIT Columns","title":"rxode2 Event Types","text":"CENS column indicator column indicating censoring occurred. pharmacokinetic modeling, censoring typically sample limit quantification. Internally rxode2 saves values nlmixr can use likelihood calculations. CENS = 0 indicates value DV measured without censoring. CENS = 1 indicates value left censored (limit quantitation) value DV censoring/quantitation limit. CENS = -1 indicates value right censored (limit quantitation) value DV censoring/quantitation limit. LIMIT additional information censoring handled nlmixr stored rxode2’s data structure well. value left censored, like limit 1 may also believe value certain threshold, like zero. case, limit 0 indicates censored value 0 1. short : CENS = 0 LIMIT ignored observation censored CENS = 1 value censored (LIMIT, DV) CENS = -1 value censored (DV, LIMIT)","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"cmt-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"CMT Column","title":"rxode2 Event Types","text":"CMT column indicates compartment event occurs. given character string factor (preferred method), matched name model. given integer, matched order compartments appear model.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dur-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DUR Column","title":"rxode2 Event Types","text":"DUR column defines duration infusion. used set duration zero-order rate infusion.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dv-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DV Column","title":"rxode2 Event Types","text":"DV column indicates current measurement current compartment (see CMT) current measurement identifier (see DVID) may missing (see MDV) censored (see CENS).","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"dvid-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"DVID Column","title":"rxode2 Event Types","text":"TODO","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"evid-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"EVID Column","title":"rxode2 Event Types","text":"EVID column event identifier row data. observation records, 0. normal dosing records, 1. Many EVID values detailed rxode2 Event Types Classic rxode2 Events vignettes.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"id-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"ID Column","title":"rxode2 Event Types","text":"ID column subject identifier. column used separate one individual (usually single person animal) another. model, ID column used separate individuals. numerical integrator re-initializes new individual, new values random effects selected.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-datasets.html","id":"rate-column","dir":"Articles","previous_headings":"Details for Specific Dataset Columns","what":"RATE Column","title":"rxode2 Event Types","text":"TODO","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"creating-rxode2s-event-tables","dir":"Articles","previous_headings":"","what":"Creating rxode2’s event tables","title":"Easy rxode2 Event Tables","text":"event table rxode2 specialized data frame acts container rxode2’s events observation times. create rxode2 event table may use code eventTable(), et(), even create data frame right event information contained . closely related types events rxode2 supports. event table can add sampling/observations doses piping direct access. short table two main functions create dosing Sampling times can added add.sampling( sampling times ) et( sampling times ). Dosing intervals sampling windows also supported. documentation using et() syntax, though supported. models, can illustrate using model shared rxode2 tutorial:","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` library(units) #> udunits database from /usr/share/xml/udunits/udunits2.xml (ev <- et()) #> -- EventTable with 0 records -- #> 0 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) (ev <- et()) #> -- EventTable with 0 records -- #> 0 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) ## Model from rxode2 tutorial m1 <-function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 ## Added modeled bioavaiblity, duration and rate fdepot <- 1 durDepot <- 8 rateDepot <- 1250 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot f(depot) <- fdepot dur(depot) <- durDepot rate(depot) <- rateDepot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff; eff(0) <- 1 }) }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"adding-doses-to-the-event-table","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Adding doses to the event table","title":"Easy rxode2 Event Tables","text":"created can add dosing event table add.dosing(), et() functions. Using add.dosing() function : Notice units specified table. specified, units use units package keep track units convert needed. Additionally, ggforce uses label ggplot axes. set_units drop_units useful set drop rxode2 event table units. example, can see time axes labeled: familiar NONMEM/rxode2 event records, can also specify dosing using et dose elements directly: gives: shows easy creating event tables can .","code":"ev <- eventTable(amount.units=\"mg\", time.units=\"hr\") ## The methods ar attached to the event table, so you can use ## them directly ev$add.dosing(dose=10000, nbr.doses = 3)# loading doses ## Starts at time 0; Default dosing interval is 24 ## You can also pipe the event tables to these methods. ev <- ev %>% add.dosing(dose=5000, nbr.doses=14, dosing.interval=12)# maintenance ev #> -- EventTable with 2 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 2 x 5 #> time amt ii addl evid #> [h] [mg] [h] #> 1 0 10000 24 2 1:Dose (Add) #> 2 0 5000 12 13 1:Dose (Add) rxSolve(m1, ev) %>% plot(C2) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) # loading doses ev #> -- EventTable with 1 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 10000 12 6 1:Dose (Add) rxSolve(m1, ev) %>% plot(C2) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"adding-sampling-to-an-event-table","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Adding sampling to an event table","title":"Easy rxode2 Event Tables","text":"notice examples, rxode2 generated default sampling times since sampling times. wish control sampling time, add samples rxode2 event table add.sampling et gives: use et can simply add similar way add.sampling: gives following rxode2 solve: Note jagged nature plots since sample times.","code":"ev <- eventTable(amount.units=\"mg\", time.units=\"hr\") ## The methods ar attached to the event table, so you can use them ## directly ev$add.dosing(dose=10000, nbr.doses = 3)# loading doses ev$add.sampling(seq(0,24,by=4)) ev #> -- EventTable with 8 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 7 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 8 x 5 #> time amt ii addl evid #> [h] [mg] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 24 2 1:Dose (Add) #> 3 4 NA NA NA 0:Observation #> 4 8 NA NA NA 0:Observation #> 5 12 NA NA NA 0:Observation #> 6 16 NA NA NA 0:Observation #> 7 20 NA NA NA 0:Observation #> 8 24 NA NA NA 0:Observation solve(m1, ev) %>% plot(C2) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) %>% # loading doses et(seq(0,24,by=4)) ev #> -- EventTable with 8 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 7 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 8 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 6 1:Dose (Add) #> 3 4 NA NA NA 0:Observation #> 4 8 NA NA NA 0:Observation #> 5 12 NA NA NA 0:Observation #> 6 16 NA NA NA 0:Observation #> 7 20 NA NA NA 0:Observation #> 8 24 NA NA NA 0:Observation solve(m1, ev) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"expand-the-event-table-to-a-multi-subject-event-table-","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Expand the event table to a multi-subject event table.","title":"Easy rxode2 Event Tables","text":"thing needed expand event table list IDs want expand; can see following simulation 4 individuals solved :","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, until = set_units(3, days), ii=12) %>% # loading doses et(seq(0,48,length.out=200)) %>% et(id=1:4) ev #> -- EventTable with 804 records -- #> 4 dosing records (see x$get.dosing(); add with add.dosing or et) #> 800 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 804 x 6 #> id time amt ii addl evid #> [h] [h] #> 1 1 0 NA NA NA 0:Observation #> 2 1 0 10000 12 6 1:Dose (Add) #> 3 1 0.241 NA NA NA 0:Observation #> 4 1 0.482 NA NA NA 0:Observation #> 5 1 0.724 NA NA NA 0:Observation #> 6 1 0.965 NA NA NA 0:Observation #> 7 1 1.21 NA NA NA 0:Observation #> 8 1 1.45 NA NA NA 0:Observation #> 9 1 1.69 NA NA NA 0:Observation #> 10 1 1.93 NA NA NA 0:Observation #> # i 794 more rows set.seed(42) rxSetSeed(42) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"add-doses-and-samples-within-a-sampling-window","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Add doses and samples within a sampling window","title":"Easy rxode2 Event Tables","text":"addition adding fixed doses fixed sampling times, can windows sample draw doses . dosing windows specify time ordered numerical vector lowest dosing time highest dosing time inside list. example, start dosing time 6 hour dosing window: can clearly see different dosing times following simulation: course reality dosing interval may 2 hours: sort thing can specified sampling times. specify sampling times terms sampling window, can create list sampling times. sampling time two element ordered numeric vector. shows flexibility dosing sampling rxode2 event tables allow.","code":"set.seed(42) rxSetSeed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,6)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) ev #> -- EventTable with 16 records -- #> 16 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 16 x 6 #> id low time high amt evid #> [h] [h] [h] #> 1 1 0 5.49 6 10000 1:Dose (Add) #> 2 1 12 17.0 18 10000 1:Dose (Add) #> 3 1 24 25.7 30 10000 1:Dose (Add) #> 4 1 36 41.6 42 10000 1:Dose (Add) #> 5 2 0 4.31 6 10000 1:Dose (Add) #> 6 2 12 14.7 18 10000 1:Dose (Add) #> 7 2 24 28.2 30 10000 1:Dose (Add) #> 8 2 36 39.9 42 10000 1:Dose (Add) #> 9 3 0 0.808 6 10000 1:Dose (Add) #> 10 3 12 16.4 18 10000 1:Dose (Add) #> 11 3 24 27.1 30 10000 1:Dose (Add) #> 12 3 36 39.9 42 10000 1:Dose (Add) #> 13 4 0 4.98 6 10000 1:Dose (Add) #> 14 4 12 13.7 18 10000 1:Dose (Add) #> 15 4 24 29.6 30 10000 1:Dose (Add) #> 16 4 36 41.5 42 10000 1:Dose (Add) ev <- ev %>% et(seq(0,48,length.out=200)) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) set.seed(42) rxSetSeed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,2)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) %>% et(seq(0,48,length.out=200)) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) rxSetSeed(42) set.seed(42) ev <- et(timeUnits=\"hr\") %>% et(time=list(c(0,2)), amt=10000, until = set_units(2, days), ii=12) %>% # loading doses et(id=1:4) ## Create 20 samples in the first 24 hours and 20 samples in the ## second 24 hours samples <- c(lapply(1:20, function(...){c(0,24)}), lapply(1:20, function(...){c(20,48)})) ## Add the random collection to the event table ev <- ev %>% et(samples) library(ggplot2) solve(m1, ev, params=data.frame(KA=0.294*exp(rnorm(4)), CL=18.6*exp(rnorm(4)))) %>% plot(C2) + geom_point()"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"combining-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Combining event tables","title":"Easy rxode2 Event Tables","text":"Since can create dosing records sampling records, can create complex dosing regimen wish. addition, rxode2 allows combine event tables c, seq, rep, rbind.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"sequencing-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Sequencing event tables","title":"Easy rxode2 Event Tables","text":"One way combine event table sequence c, seq etSeq. takes two dosing groups adds least one inter-dose interval : sequencing events, can also separate sequence period time; example wanted separate week, easily following sequence event tables: Note example time bid qd event tables exactly one week, 1 week plus 24 hours inter-dose interval. want behavior, can sequence using wait=\"+ii\". Also note, rxode2 assumes dosing want space event tables , clears sampling records combine event tables. true, can also use option samples=\"use\"","code":"## bid for 5 days bid <- et(timeUnits=\"hr\") %>% et(amt=10000,ii=12,until=set_units(5, \"days\")) ## qd for 5 days qd <- et(timeUnits=\"hr\") %>% et(amt=20000,ii=24,until=set_units(5, \"days\")) ## bid for 5 days followed by qd for 5 days et <- seq(bid,qd) %>% et(seq(0,11*24,length.out=100)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days followed by qd for 5 days et <- seq(bid,set_units(1, \"week\"), qd) %>% et(seq(0,18*24,length.out=100)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days followed by qd for 5 days et <- seq(bid,set_units(1, \"week\"), qd,wait=\"+ii\") %>% et(seq(0,18*24,length.out=100)); rxSolve(m1, et) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"repeating-event-tables","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Repeating event tables","title":"Easy rxode2 Event Tables","text":"can event table can repeat etRep rep. example 4 rounds 2 weeks QD therapy 1 week therapy can simply specified: simplified way use sequence event tables. Therefore, many options still apply; samples cleared unless use samples=\"use\", time event tables least inter-dose interval. can adjust timing wait option.","code":"qd <-et(timeUnits = \"hr\") %>% et(amt=10000, ii=24, until=set_units(2, \"weeks\"), cmt=\"depot\") et <- rep(qd, times=4, wait=set_units(1,\"weeks\")) %>% add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) rxSolve(m1, et) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"combining-event-tables-with-rbind","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Combining event tables with rbind","title":"Easy rxode2 Event Tables","text":"may combine event tables rbind. consider event times combining event tables, keeps times. space event tables waiting period, also consider inter-dose interval. Using previous seq can clearly see difference. sequence: bind together rbind Still waiting period applies (consider inter-dose interval) can also bind tables together make ID event table unique; can good combine cohorts different expected dosing sampling times. requires id=\"unique\" option; Using first example shows different case:","code":"## bid for 5 days bid <- et(timeUnits=\"hr\") %>% et(amt=10000,ii=12,until=set_units(5, \"days\")) ## qd for 5 days qd <- et(timeUnits=\"hr\") %>% et(amt=20000,ii=24,until=set_units(5, \"days\")) et <- seq(bid,qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days et <- rbind(bid,qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) et <- rbind(bid,wait=set_units(10,days),qd) %>% et(seq(0,18*24,length.out=500)); rxSolve(m1, et) %>% plot(C2) ## bid for 5 days et <- etRbind(bid,qd, id=\"unique\") %>% et(seq(0,150,length.out=500)); library(ggplot2) rxSolve(m1, et) %>% plot(C2) + facet_wrap( ~ id)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-table.html","id":"event-tables-in-rstudio-notebooks","dir":"Articles","previous_headings":"Creating rxode2’s event tables","what":"Event tables in Rstudio Notebooks","title":"Easy rxode2 Event Tables","text":"addition output console shown examples, Rstudio notebook output different can seen following screenshots; first screenshot shows event table looks evaluating Rstduio notebook simple dataframe allows page contents. click first box Rstudio notebook output, notes event table: ## Expanding events Event tables can expanded contain addl data item, like following example: can expand events addl items $expand() etExpand(ev): first, etExpand(ev) expands event table without modifying original data frame: can see addl events expanded, however original data frame remained intact: use ev$expand() modify ev object. similar object-oriented method:","code":"ev <- et() %>% et(dose=50, ii=8, until=48) ev #> -- EventTable with 1 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> #> 1 0 50 8 6 1:Dose (Add) etExpand(ev) #> -- EventTable with 7 records -- #> 7 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 7 x 4 #> time amt ii evid #> #> 1 0 50 0 1:Dose (Add) #> 2 8 50 0 1:Dose (Add) #> 3 16 50 0 1:Dose (Add) #> 4 24 50 0 1:Dose (Add) #> 5 32 50 0 1:Dose (Add) #> 6 40 50 0 1:Dose (Add) #> 7 48 50 0 1:Dose (Add) print(ev) #> -- EventTable with 1 records -- #> 1 dosing records (see $get.dosing(); add with add.dosing or et) #> 0 observation times (see $get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with $expand(); or etExpand() #> -- First part of : -- #> # A tibble: 1 x 5 #> time amt ii addl evid #> #> 1 0 50 8 6 1:Dose (Add) ev$expand() ev #> -- EventTable with 7 records -- #> 7 dosing records (see x$get.dosing(); add with add.dosing or et) #> 0 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 7 x 4 #> time amt ii evid #> #> 1 0 50 0 1:Dose (Add) #> 2 8 50 0 1:Dose (Add) #> 3 16 50 0 1:Dose (Add) #> 4 24 50 0 1:Dose (Add) #> 5 32 50 0 1:Dose (Add) #> 6 40 50 0 1:Dose (Add) #> 7 48 50 0 1:Dose (Add)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"rxode2-event-tables","dir":"Articles","previous_headings":"","what":"rxode2 event tables","title":"rxode2 Event Types","text":"general, rxode2 event tables follow NONMEM dataset convention exceptions: may turn compartment negative compartment number “-cmt” cmt compartment name. compartment data item (cmt) can still number, number compartment defined appearance compartment name model. can tedious count, can specify compartment numbers easier using cmt(cmtName) beginning model. Bioavailability changes change rate infusion since dur/amt fixed input data. Similarly, specifying rate/amt infusion, bioavailability change infusion duration since rate/amt fixed input data. infrequent NONMEM columns supported: pcmt, call. evid=5 replace event; replaces value compartment value specified amt column. equivalent deSolve=replace. evid=6 multiply event; multiplies value compartment value specified amt column. equivalent deSolve=multiply. evid=7 transit compartment model/phantom event. puts dose dose() function calculates time since last dose tad() doesn’t actually put dose compartment. allows transit() function easily apply compartment. legal entries data table: notes: evid can classic RxODE (described ) NONMEM-style evid described . NONMEM’s DV required; rxode2 ODE solving framework. NONMEM’s MDV required, since captured EVID. Instead NONMEM-compatible data, can accept deSolve compatible data-frames. returning rxode2 solved data-set additional event ids (EVID) may see depending solving options: EVID = -1 modeled rate ends (corresponds rate = -1) EVID = -2 modeled duration ends (corresponds rate=-2) EVID = -10 rate specified zero-order infusion ends (corresponds rate > 0) EVID = -20 duration specified zero-order infusion ends (corresponds dur > 0) EVID = 101, 102, 103,... correspond 1, 2, 3, … modeled time (mtime). can accessed solving option combination addDosing=TRUE subsetNonmem=FALSE. want see classic EVID equivalents can use addDosing=NA. illustrate event types use model original rxode2 tutorial.","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` ## Model from rxode2 tutorial m1 <- function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 ## Added modeled bioavaiblity, duration and rate fdepot <- 1 durDepot <- 8 rateDepot <- 1250 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot f(depot) <- fdepot dur(depot) <- durDepot rate(depot) <- rateDepot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff eff(0) <- 1 }) }"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"bolusadditive-doses","dir":"Articles","previous_headings":"","what":"Bolus/Additive Doses","title":"rxode2 Event Types","text":"bolus dose default type dose rxode2 requires amt/dose. Note uses convenience function et() described rxode2 event tables","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 2 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev) %>% plot(C2) + xlab(\"Time\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"infusion-doses","dir":"Articles","previous_headings":"","what":"Infusion Doses","title":"rxode2 Event Types","text":"different type infusions rxode2 supports: Constant Rate Infusion (rate) Constant Duration Infusion (dur) Estimated Rate Infusion Estimated Duration Infusion","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"constant-infusion-in-terms-of-duration-and-rate","dir":"Articles","previous_headings":"Infusion Doses","what":"Constant Infusion (in terms of duration and rate)","title":"rxode2 Event Types","text":"next type event infusion; two ways specify infusion; first dur keyword. example : can also specified rate component: exception bioavailability changes infusion. case modeling rate, bioavailability decrease, decreases infusion duration, NONMEM. example: Similarly increasing bioavailability increases infusion duration. rationale behavior rate amt specified event table, thing can change bioavailability increase duration infusion. specify amt dur components event table, bioavailability changes affect rate infusion. can see side--side comparison bioavailability changes affecting rate instead duration records following plots:","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, dur=8) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt ii addl evid dur #> [h] [h] [h] #> 1 0 NA NA NA 0:Observation NA #> 2 0 10000 12 2 1:Dose (Add) 8 #> 3 0.242 NA NA NA 0:Observation NA #> 4 0.485 NA NA NA 0:Observation NA #> 5 0.727 NA NA NA 0:Observation NA #> 6 0.970 NA NA NA 0:Observation NA #> 7 1.21 NA NA NA 0:Observation NA #> 8 1.45 NA NA NA 0:Observation NA #> 9 1.70 NA NA NA 0:Observation NA #> 10 1.94 NA NA NA 0:Observation NA #> # i 91 more rows rxSolve(m1, ev) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=10000/8) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 1250 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev) %>% plot(depot, C2) + xlab(\"Time\") rxSolve(m1, ev, c(fdepot=0.25)) %>% plot(depot, C2) + xlab(\"Time\") rxSolve(m1, ev, c(fdepot=1.25)) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, dur=8) %>% et(seq(0, 24, length.out=100)) library(ggplot2) library(patchwork) p1 <- rxSolve(m1, ev, c(fdepot=1.25)) %>% plot(depot) + xlab(\"Time\") + ylim(0,5000) p2 <- rxSolve(m1, ev, c(fdepot=0.25)) %>% plot(depot) + xlab(\"Time\")+ ylim(0,5000) ## Use patchwork syntax to combine plots p1 * p2"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"modeled-rate-and-duration-of-infusion","dir":"Articles","previous_headings":"Infusion Doses","what":"Modeled Rate and Duration of Infusion","title":"rxode2 Event Types","text":"can model duration, equivalent NONMEM’s rate=-2. Similarly, may also model rate. equivalent NONMEM’s rate=-1 rxode2’s event table specifies data item well.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=-2) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 -2:dur 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev, c(durDepot=7)) %>% plot(depot, C2) + xlab(\"Time\") ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12,until=24, rate=-1) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 101 x 6 #> time amt rate ii addl evid #> [h] [h] #> 1 0 NA NA NA NA 0:Observation #> 2 0 10000 -1:rate 12 2 1:Dose (Add) #> 3 0.242 NA NA NA NA 0:Observation #> 4 0.485 NA NA NA NA 0:Observation #> 5 0.727 NA NA NA NA 0:Observation #> 6 0.970 NA NA NA NA 0:Observation #> 7 1.21 NA NA NA NA 0:Observation #> 8 1.45 NA NA NA NA 0:Observation #> 9 1.70 NA NA NA NA 0:Observation #> 10 1.94 NA NA NA NA 0:Observation #> # i 91 more rows rxSolve(m1, ev, c(rateDepot=10000/3)) %>% plot(depot, C2) + xlab(\"Time\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state","dir":"Articles","previous_headings":"","what":"Steady State","title":"rxode2 Event Types","text":"doses solved steady state reached constant inter-dose interval.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, ss=1) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 101 records -- #> 1 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> -- First part of x: -- #> # A tibble: 101 x 5 #> time amt ii evid ss #> [h] [h] #> 1 0 NA NA 0:Observation NA #> 2 0 10000 12 1:Dose (Add) 1 #> 3 0.242 NA NA 0:Observation NA #> 4 0.485 NA NA 0:Observation NA #> 5 0.727 NA NA 0:Observation NA #> 6 0.970 NA NA 0:Observation NA #> 7 1.21 NA NA 0:Observation NA #> 8 1.45 NA NA 0:Observation NA #> 9 1.70 NA NA 0:Observation NA #> 10 1.94 NA NA 0:Observation NA #> # i 91 more rows rxSolve(m1, ev) %>% plot(C2)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state-for-complex-dosing","dir":"Articles","previous_headings":"Steady State","what":"Steady state for complex dosing","title":"rxode2 Event Types","text":"using ss=2 flag, can use super-positioning principle linear kinetics get steady state nonstandard dosing (.e. morning 100 mg vs evening 150 mg). done : Saving state values Resetting states solving system steady state Adding back prior state values can see takes full dose cycle reach true complex steady state dosing.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=24, ss=1) %>% et(time=12, amt=15000, ii=24, ss=2) %>% et(time=24, amt=10000, ii=24, addl=3) %>% et(time=36, amt=15000, ii=24, addl=3) %>% et(seq(0, 64, length.out=500)) library(ggplot2) rxSolve(m1, ev,maxsteps=10000) %>% plot(C2) + annotate(\"rect\", xmin=0, xmax=24, ymin=-Inf, ymax=Inf, alpha=0.2) + annotate(\"text\", x=12.5, y=7, label=\"Initial Steady State Period\") + annotate(\"text\", x=44, y=7, label=\"Steady State AM/PM dosing\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"steady-state-for-constant-infusion-or-zero-order-processes","dir":"Articles","previous_headings":"Steady State","what":"Steady state for constant infusion or zero order processes","title":"rxode2 Event Types","text":"last type steady state rxode2 supports steady-state constant infusion rate. can specified way NONMEM, : inter-dose interval ii=0 steady state dose, ie ss=1 Either positive rate (rate>0) estimated rate rate=-1. zero dose, ie amt=0 steady-state constant infusion achieved, infusion turned using record, just like NONMEM. Note rate=-2 model duration infusion doesn’t make much sense since solving infusion steady state. duration specified steady state solution. Also note bioavailability changes steady state infusion also make sense neither change rate duration steady state infusion. Hence modeled bioavailability type dosing event ignored. example: can used PK, can used steady-state disease processes.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=0, ss=1,rate=10000/8) p1 <- rxSolve(m1, ev) %>% plot(C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=200000, rate=10000/8) %>% et(0, 250, length.out=1000) p2 <- rxSolve(m1, ev) %>% plot(C2, eff) library(patchwork) p1 / p2"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"reset-events","dir":"Articles","previous_headings":"","what":"Reset Events","title":"rxode2 Event Types","text":"Reset events implemented evid=3 evid=reset, reset evid=4 reset dose. solving show happens system system reset 6 hours post-dose. can see compartments reset initial values. next dose start dosing cycle . case, whole system reset dose given","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, evid=reset) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 3 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, amt=10000, evid=4) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 5 #> time amt ii addl evid #> [h] [h] #> 1 0 NA NA NA 0:Observation #> 2 0 10000 12 3 1:Dose (Add) #> 3 0.242 NA NA NA 0:Observation #> 4 0.485 NA NA NA 0:Observation #> 5 0.727 NA NA NA 0:Observation #> 6 0.970 NA NA NA 0:Observation #> 7 1.21 NA NA NA 0:Observation #> 8 1.45 NA NA NA 0:Observation #> 9 1.70 NA NA NA 0:Observation #> 10 1.94 NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-event-types.html","id":"turning-off-compartments","dir":"Articles","previous_headings":"","what":"Turning off compartments","title":"rxode2 Event Types","text":"may also turn compartment, similar reset event. Solving shows system: case, depot turned , depot compartment concentrations set initial values compartment concentrations/levels reset. another dose depot administered depot compartment turned back . Note dose compartment turns back compartment dosed. Hence turn effect compartment, continues another dose depot. turn back compartment, zero-dose compartment evid=2 compartment needed.","code":"ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-depot\", evid=2) %>% et(seq(0, 24, length.out=100)) ev #> -- EventTable with 102 records -- #> 2 dosing records (see x$get.dosing(); add with add.dosing or et) #> 100 observation times (see x$get.sampling(); add with add.sampling or et) #> multiple doses in `addl` columns, expand with x$expand(); or etExpand(x) #> -- First part of x: -- #> # A tibble: 102 x 6 #> time cmt amt ii addl evid #> [h] [h] #> 1 0 (obs) NA NA NA 0:Observation #> 2 0 (default) 10000 12 3 1:Dose (Add) #> 3 0.242 (obs) NA NA NA 0:Observation #> 4 0.485 (obs) NA NA NA 0:Observation #> 5 0.727 (obs) NA NA NA 0:Observation #> 6 0.970 (obs) NA NA NA 0:Observation #> 7 1.21 (obs) NA NA NA 0:Observation #> 8 1.45 (obs) NA NA NA 0:Observation #> 9 1.70 (obs) NA NA NA 0:Observation #> 10 1.94 (obs) NA NA NA 0:Observation #> # i 92 more rows rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-eff\", evid=2) %>% et(seq(0, 24, length.out=100)) rxSolve(m1, ev) %>% plot(depot,C2, eff) ev <- et(timeUnits=\"hr\") %>% et(amt=10000, ii=12, addl=3) %>% et(time=6, cmt=\"-eff\", evid=2) %>% et(time=12,cmt=\"eff\",evid=2) %>% et(seq(0, 24, length.out=100)) rxSolve(m1, ev) %>% plot(depot,C2, eff)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"classic-rxode-evid-values","dir":"Articles","previous_headings":"","what":"Classic RxODE evid values","title":"Classic rxode2 Events","text":"Originally RxODE supported compound event IDs; rxode2 still supports parameters, often useful use normal NONMEM dataset standard used many modeling tools like NONMEM, Monolix nlmixr, described rxode2 types article. Classically, RxODE supported event coding single event id evid described following table. classic EVID concatenate numbers table, infusion compartment 1 10101 infusion compartment 199 119901. EVID = 0 (observations), EVID=2 (type event) EVID=3 supported. Internally EVID=9 non-observation event makes sure system initialized zero; EVID=9 manually set. EVID 10-99 represents modeled time interventions, similar NONMEM’s MTIME. along amount (amt) time columns specify events ODE system. infusions specified EVIDs > 100 amt column represents rate value. Infusion flags 1 2 +amt turn infusion specific compartment -amt turn infusion specific compartment. specify dose/duration place dosing records time duration starts stops. modeled rate/duration infusion flags infusion flag must followed infusion record. number concatenated together form full RxODE event ID, shown following examples:","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"bolus-dose-examples","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Bolus Dose Examples","title":"Classic rxode2 Events","text":"100 bolus dose compartment #1 time 0 100 bolus dose compartment #99 time 0 100 bolus dose compartment #199 time 0","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"infusion-event-examples","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Infusion Event Examples","title":"Classic rxode2 Events","text":"Bolus infusion rate 50 compartment 1 1.5 hr, (modeled bioavailability changes duration infusion) Bolus infusion rate 50 compartment 1 1.5 hr (modeled bioavailability changes rate infusion) Modeled rate amount 50 Modeled duration amount 50","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"steady-state-for-classic-rxode-evid-example","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Steady State for classic RxODE EVID example","title":"Classic rxode2 Events","text":"Steady state dose cmt 1 Steady State super-positioning principle 50 pm 100 dose","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"steady-state-with-lagged-dose-for-classic-rxode-evid","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Steady state with lagged dose for classic RxODE evid","title":"Classic rxode2 Events","text":"Steady state lagged dose bolus dose: time | evid | amt | ii | 0 | 109 | 100 | 24 | 0 | 101 | 100 | 0 | event 109 calculates trough amount steady state passed (ii-lag_time) event 101 applies next steady state dose. Steady state (=2) lagged bolus dose Steady state infusion lag time time | evid | amt | ii | 0 | 10109 | 5 | 24 | 0 | 10108 | -5 | 24 | 0 | 10101 | 5 | | 20 | 10101 | -5 | | case bolus, 10109 event calculates trough concentration ii=24, may (may ) still infusion running. infusion running 10108 event turn infusion appropriate time. infusion completed, 10108 event ignored. next 2 events 10101 represent event times (assuming bioavailability applied).","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-events-classic.html","id":"turning-off-a-compartment-with-classic-rxode-evid","dir":"Articles","previous_headings":"Classic RxODE evid values","what":"Turning off a compartment with classic RxODE EVID","title":"Classic rxode2 Events","text":"Turn first compartment time 12 Event coding rxode2 encoded single event number evid. compartments 100, coded : event 0 observation events. 100*(Compartment Number) + 1 dose captured amt 10000 + 100*(Compartment Number) + 1 infusion rate captured amt column infusion turned subtracting amt evid stop infusion. compartments greater equal 100, 100s place digits transferred 100,000th place digit. doses 99th compartment evid bolus dose 9901 evid infusion 19901. bolus dose 199th compartment evid bolus dose 109901. infusion dosing record 199th compartment 119901.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to rxode2","text":"rxode2 R package facilitates simulation ODE models R. designed pharmacometrics models mind, can applied generally ODE model.","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"description-of-rxode2-illustrated-through-an-example","dir":"Articles","previous_headings":"","what":"Description of rxode2 illustrated through an example","title":"Introduction to rxode2","text":"model equations can specified text string, model file R expression. differential algebraic equations permitted. Differential equations specified d/dt(var_name) =. equation can separated semicolon. load rxode2 package compile model: Model parameters may specified ini({}) model block, initial conditions can specified within model cmt(0)= X, like model eff(0) <- 1. may also specify subject variability initial conditions residual error components just like nlmixr2. allows single interface nlmixr2/rxode2 models. Also note, classic rxode2 interface still works just like past (don’t worry breaking code time). fact, can get classic rxode2 model $simulationModel ui object:","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` mod1 <- function() { ini({ # central KA=2.94E-01 CL=1.86E+01 V2=4.02E+01 # peripheral Q=1.05E+01 V3=2.97E+02 # effects Kin=1 Kout=1 EC50=200 }) model({ C2 <- centr/V2 C3 <- peri/V3 d/dt(depot) <- -KA*depot d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) <- Q*C2 - Q*C3 eff(0) <- 1 d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff }) } mod1 <- mod1() # create the ui object (can also use `rxode2(mod1)`) mod1 summary(mod1$simulationModel)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"specify-dosing-and-sampling-in-rxode2","dir":"Articles","previous_headings":"Description of rxode2 illustrated through an example","what":"Specify Dosing and sampling in rxode2","title":"Introduction to rxode2","text":"rxode2 provides simple flexible way specify dosing sampling functions generate event table. First, empty event table generated “et()” function. interface similar NONMEM event tables: can see code, can dose compartment named rxode2 model. slight deviation NONMEM can reduce need compartment renumbering. events can also combined expanded (multi-subject events complex regimens) rbind, c, seq, rep. information creating complex dosing regimens using rxode2 see rxode2 events vignette.","code":"ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9,ii=12,cmt=\"depot\") %>% et(time=120, amt=2000, addl=4, ii=14, cmt=\"depot\") %>% et(0:240) # Add sampling"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-intro.html","id":"solving-odes","dir":"Articles","previous_headings":"Description of rxode2 illustrated through an example","what":"Solving ODEs","title":"Introduction to rxode2","text":"ODE can now solved using rxSolve: returns modified data frame. can see compartment values plot : , Note labels automatically labeled units initial event table. rxode2 extracts units label plot (present).","code":"x <- mod1 %>% rxSolve(ev) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ x #> ── Solved rxode2 object ── #> ── Parameters (x$params): ── #> KA CL V2 Q V3 Kin Kout EC50 #> 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 #> ── Initial Conditions (x$inits): ── #> depot centr peri eff #> 0 0 0 1 #> ── First part of data (object): ── #> # A tibble: 241 × 7 #> time C2 C3 depot centr peri eff #> [h] #> 1 0 0 0 10000 0 0 1 #> 2 1 44.4 0.920 7453. 1784. 273. 1.08 #> 3 2 54.9 2.67 5554. 2206. 794. 1.18 #> 4 3 51.9 4.46 4140. 2087. 1324. 1.23 #> 5 4 44.5 5.98 3085. 1789. 1776. 1.23 #> 6 5 36.5 7.18 2299. 1467. 2132. 1.21 #> # ℹ 235 more rows library(ggplot2) plot(x,C2) + ylab(\"Central Concentration\") plot(x,eff) + ylab(\"Effect\")"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"prediction-only-models","dir":"Articles","previous_headings":"","what":"Prediction only models","title":"rxode2 additional model types","text":"Prediction models simple create. use rxode2 syntax without ODE systems . simple example one-compartment model. Solving rxode2 models saving simple ODE system, faster course.","code":"library(rxode2) ## rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) ## no cache: create with `rxCreateCache()` mod <- function(){ model({ ipre <- 10 * exp(-ke * t) }) } et <- et(seq(0,24,length.out=50)) cmt1 <- rxSolve(mod,et,params=c(ke=0.5)) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ cmt1 ## -- Solved rxode2 object -- ## -- Parameters (x$params): -- ## ke ## 0.5 ## -- Initial Conditions (x$inits): -- ## named numeric(0) ## -- First part of data (object): -- ## # A tibble: 50 x 2 ## time ipre ## ## 1 0 10 ## 2 0.490 7.83 ## 3 0.980 6.13 ## 4 1.47 4.80 ## 5 1.96 3.75 ## 6 2.45 2.94 ## # i 44 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"solved-compartment-models","dir":"Articles","previous_headings":"","what":"Solved compartment models","title":"rxode2 additional model types","text":"Solved models also simple create. simply place linCmt() psuedo-function code. linCmt() function figures type model use based parameter names specified. often, pharmacometric models parameterized terms volume clearances. Clearances specified NONMEM-style names CL, Q, Q1, Q2, etc. distributional clearances CLD, CLD2. Volumes specified Central (VC V), Peripheral/Tissue (VP, VT). translations available, example translations : Another popular parameterization terms micro-constants. rxode2 assumes compartment 1 central compartment. elimination constant specified K, Ke Kel. example translations : last parameterization possible using alpha V //B/C. example translations : linCmt() sleuthing complete, 1, 2 3 compartment model solution used value linCmt(). compartments can dose linear solved system depot central linear absorption constant model ka. Without additional ODEs, compartments numbered depot=1 central=2. absorption constant ka missing, may dose central compartment. Without additional ODEs compartment number central=1. compartments take sort events ODE model can take, discussed rxode2 events vignette. acts ODE model; specify dose depot compartment solve system:","code":"mod <- function() { ini({ kel <- 0.5 V <- 1 }) model({ ipre <- linCmt(V, kel) }) } et <- et(amt=10,time=0,cmt=depot) %>% et(seq(0,24,length.out=50)) cmt1 <- rxSolve(mod,et) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ cmt1 ## -- Solved rxode2 object -- ## -- Parameters (x$params): -- ## kel V ## 0.5 1.0 ## -- Initial Conditions (x$inits): -- ## named numeric(0) ## -- First part of data (object): -- ## # A tibble: 50 x 2 ## time ipre ## ## 1 0 10 ## 2 0.490 7.83 ## 3 0.980 6.13 ## 4 1.47 4.80 ## 5 1.96 3.75 ## 6 2.45 2.94 ## # i 44 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-model-types.html","id":"mixing-solved-systems-and-odes","dir":"Articles","previous_headings":"","what":"Mixing Solved Systems and ODEs","title":"rxode2 additional model types","text":"addition pure ODEs, may mix solved systems ODEs. prior 2-compartment indirect response model can simplified linCmt() function: allows indirect response model assign 2-compartment model C2 variable used indirect response model. mixing solved systems ODEs, solved system’s compartment always last compartment. solved system technically isn’t compartment solved. Adding dosing compartment end interfere actual ODE solved. Therefore,two-compartment indirect response model, effect compartment compartment #1 PK dosing compartment depot compartment #2. compartment model requires new event table since compartment number changed: can solved following command: Note solving require specifying effect compartment initial condition 1. Rather, already pre-specified eff(0)=1. can solved different initial conditions easily: rxode2 detective also require specify variables linCmt() function already defined block. Therefore, following function also work solve system. Note specify parameters solving system since built model, can override parameters:","code":"library(rxode2) ## Setup example model mod1 <-function() { model({ C2 = centr/V2 C3 = peri/V3 d/dt(depot) =-KA*depot d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) = Q*C2 - Q*C3 d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff }) } ## Seup parameters and initial conditions theta <- c(KA=2.94E-01, CL=1.86E+01, V2=4.02E+01, # central Q=1.05E+01, V3=2.97E+02, # peripheral Kin=1, Kout=1, EC50=200) # effects inits <- c(eff=1) ## Setup dosing event information ev <- et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9, ii=12) %>% et(amt=20000, addl=4, time=120, ii=24) %>% add.sampling(0:240) ## Setup a mixed solved/ode system: mod2 <- function() { model({ ## the order of variables do not matter, the type of compartmental ## model is determined by the parameters specified. C2 = linCmt(KA, CL, V2, Q, V3); eff(0) = 1 ## This specifies that the effect compartment starts at 1. d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff; }) } ev <- et(amountUnits='mg', timeUnits='hours') %>% et(amt=10000, addl=9, ii=12, cmt=2) %>% et(amt=20000, addl=4, time=120, ii=24, cmt=2) %>% et(0:240) x <- mod2 %>% solve(theta, ev) ## using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows x <- mod2 %>% solve(theta, ev,c(eff=2)) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 2 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 2 ## 2 1 121. 1.93 ## 3 2 60.3 1.67 ## 4 3 31.0 1.41 ## 5 4 17.0 1.23 ## 6 5 10.2 1.13 ## # i 235 more rows mod3 <- function() { ini({ KA <- 2.94E-01 CL <- 1.86E+01 V2 <- 4.02E+01 Q <- 1.05E+01 V3 <- 2.97E+02 Kin <- 1 Kout <- 1 EC50 <- 200 }) model({ # Since the parameters are in the ini block, put them in linCmt so # that the model is detected correctly C2 <- linCmt(KA, CL, V2, Q, V3) eff(0) <- 1 ## This specifies that the effect compartment starts at 1. d/dt(eff) <- Kin - Kout*(1-C2/(EC50+C2))*eff; }) } x <- mod3 %>% solve(ev) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 0.294 18.600 40.200 10.500 297.000 1.000 1.000 200.000 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows x <- mod3 %>% solve(c(KA=10),ev) print(x) ## -- Solved rxode2 object -- ## -- Parameters ($params): -- ## KA CL V2 Q V3 Kin Kout EC50 ## 10.0 18.6 40.2 10.5 297.0 1.0 1.0 200.0 ## -- Initial Conditions ($inits): -- ## eff ## 1 ## -- First part of data (object): -- ## # A tibble: 241 x 3 ## time C2 eff ## [h] ## 1 0 249. 1 ## 2 1 121. 1.35 ## 3 2 60.3 1.38 ## 4 3 31.0 1.28 ## 5 4 17.0 1.18 ## 6 5 10.2 1.11 ## # i 235 more rows"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"nesting-in-rxode2","dir":"Articles","previous_headings":"","what":"Nesting in rxode2","title":"Nesting levels in rxode2","text":"one level nesting possible rxode2; example using following uncertainties sources variability:","code":""},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"event-table","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Event table","title":"Nesting levels in rxode2","text":"event table contains nesting variables: inv: investigator id id: subject id eye: eye id (left right) occ: occasion","code":"library(rxode2) #> rxode2 2.0.14.9000 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union et(amountUnits=\"mg\", timeUnits=\"hours\") %>% et(amt=10000, addl=9,ii=12,cmt=\"depot\") %>% et(time=120, amt=2000, addl=4, ii=14, cmt=\"depot\") %>% et(seq(0, 240, by=4)) %>% # Assumes sampling when there is no dosing information et(seq(0, 240, by=4) + 0.1) %>% ## adds 0.1 for separate eye et(id=1:20) %>% ## Add an occasion per dose mutate(occ=cumsum(!is.na(amt))) %>% mutate(occ=ifelse(occ == 0, 1, occ)) %>% mutate(occ=2- occ %% 2) %>% mutate(eye=ifelse(round(time) == time, 1, 2)) %>% mutate(inv=ifelse(id < 10, 1, 2)) %>% as_tibble -> ev"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"rxode2-model","dir":"Articles","previous_headings":"Nesting in rxode2","what":"rxode2 model","title":"Nesting levels in rxode2","text":"creates rxode2 model multi-level nesting. Note variables inv.Cl, inv.Ka, eta.Cl etc; need one variable level nesting.","code":"mod <- rxode2({ ## Clearance with individuals eff(0) = 1 C2 = centr/V2*(1+prop.sd) C3 = peri/V3 CL = TCl*exp(eta.Cl + eye.Cl + iov.Cl + inv.Cl) KA = TKA * exp(eta.Ka + eye.Ka + iov.Cl + inv.Ka) d/dt(depot) =-KA*depot d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3 d/dt(peri) = Q*C2 - Q*C3 d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff ef0 = eff + add.sd }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"uncertainty-in-model-parameters","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Uncertainty in Model parameters","title":"Nesting levels in rxode2","text":"","code":"theta <- c(\"TKA\"=0.294, \"TCl\"=18.6, \"V2\"=40.2, \"Q\"=10.5, \"V3\"=297, \"Kin\"=1, \"Kout\"=1, \"EC50\"=200) ## Creating covariance matrix tmp <- matrix(rnorm(8^2), 8, 8) tMat <- tcrossprod(tmp, tmp) / (8 ^ 2) dimnames(tMat) <- list(names(theta), names(theta)) tMat #> TKA TCl V2 Q V3 Kin #> TKA 0.10062025 -0.12295469 -0.04531495 -0.02397077 -0.02434600 -0.04904029 #> TCl -0.12295469 0.25162132 -0.01212188 0.02716814 0.06137190 0.05300572 #> V2 -0.04531495 -0.01212188 0.23379983 -0.02496544 -0.04012738 0.07997442 #> Q -0.02397077 0.02716814 -0.02496544 0.02821405 0.02076256 -0.04388260 #> V3 -0.02434600 0.06137190 -0.04012738 0.02076256 0.16198186 -0.11895883 #> Kin -0.04904029 0.05300572 0.07997442 -0.04388260 -0.11895883 0.26339638 #> Kout -0.03343029 -0.02601856 0.08114984 0.02523323 -0.01569376 -0.03609746 #> EC50 -0.12588070 0.14843107 -0.03577880 0.05992831 0.07451059 -0.02226063 #> Kout EC50 #> TKA -0.03343029 -0.12588070 #> TCl -0.02601856 0.14843107 #> V2 0.08114984 -0.03577880 #> Q 0.02523323 0.05992831 #> V3 -0.01569376 0.07451059 #> Kin -0.03609746 -0.02226063 #> Kout 0.09716982 0.03006571 #> EC50 0.03006571 0.31726414"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"nesting-variability","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Nesting Variability","title":"Nesting levels in rxode2","text":"specify multiple levels nesting, can specify nested lotri matrix; using approach use condition operator | specify variable nesting occurs ; Bayesian simulation need specify much information parameter; rxode2 nu parameter. case: - id, nu=100 model came 100 subjects - eye, nu=200 model came 200 eyes - occ, nu=200 model came 200 occasions - inv, nu=10 model came 10 investigators specify lotri can use | var(nu=X), :","code":"omega <- lotri(lotri(eta.Cl ~ 0.1, eta.Ka ~ 0.1) | id(nu=100), lotri(eye.Cl ~ 0.05, eye.Ka ~ 0.05) | eye(nu=200), lotri(iov.Cl ~ 0.01, iov.Ka ~ 0.01) | occ(nu=200), lotri(inv.Cl ~ 0.02, inv.Ka ~ 0.02) | inv(nu=10)) omega #> $id #> eta.Cl eta.Ka #> eta.Cl 0.1 0.0 #> eta.Ka 0.0 0.1 #> #> $eye #> eye.Cl eye.Ka #> eye.Cl 0.05 0.00 #> eye.Ka 0.00 0.05 #> #> $occ #> iov.Cl iov.Ka #> iov.Cl 0.01 0.00 #> iov.Ka 0.00 0.01 #> #> $inv #> inv.Cl inv.Ka #> inv.Cl 0.02 0.00 #> inv.Ka 0.00 0.02 #> #> Properties: nu"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"unexplained-variability","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Unexplained variability","title":"Nesting levels in rxode2","text":"last piece variability specify unexplained variability","code":"sigma <- lotri(prop.sd ~ .25, add.sd~ 0.125)"},{"path":"https://nlmixr2.github.io/rxode2/articles/rxode2-nesting.html","id":"solving-the-problem","dir":"Articles","previous_headings":"Nesting in rxode2","what":"Solving the problem","title":"Nesting levels in rxode2","text":"multiple investigators study; investigator number individuals enrolled site. rxode2 automatically determines number investigators simulate effect investigator. output, inv.Cl(inv==1) inv.Cl investigator 1, inv.Cl(inv==2) inv.Cl investigator 2, etc. inv.Cl(inv==1), inv.Cl(inv==2), etc simulated study combined form investigator variability. equation form represent following: look simulated parameters can see inv.Cl(inv==1) inv.Cl(inv==2) s$params; study: eye variability occasion variability individual simulates number variables become eye occasion variability; case eye: look simulation variables (ie eye.Cl(eye==1), eye.Cl(eye==2), etc) change individual combined make eye variability occasion variability can seen pharamcometric models.","code":"s <- rxSolve(mod, theta, ev, thetaMat=tMat, omega=omega, sigma=sigma, sigmaDf=400, nStud=400) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout #> @(lsoda.c:750 #> unhandled error message: EE:[lsoda] 70000 steps taken before reaching tout #> @(lsoda.c:750 #> Warning: some ID(s) could not solve the ODEs correctly; These values are #> replaced with 'NA' print(s) #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> # A tibble: 8,000 x 24 #> sim.id id `inv.Cl(inv==1)` `inv.Cl(inv==2)` `inv.Ka(inv==1)` #> #> 1 1 1 -0.0390 -0.0402 -0.0942 #> 2 1 2 -0.0390 -0.0402 -0.0942 #> 3 1 3 -0.0390 -0.0402 -0.0942 #> 4 1 4 -0.0390 -0.0402 -0.0942 #> 5 1 5 -0.0390 -0.0402 -0.0942 #> 6 1 6 -0.0390 -0.0402 -0.0942 #> 7 1 7 -0.0390 -0.0402 -0.0942 #> 8 1 8 -0.0390 -0.0402 -0.0942 #> 9 1 9 -0.0390 -0.0402 -0.0942 #> 10 1 10 -0.0390 -0.0402 -0.0942 #> # i 7,990 more rows #> # i 19 more variables: `inv.Ka(inv==2)` , `eye.Cl(eye==1)` , #> # `eye.Cl(eye==2)` , `eye.Ka(eye==1)` , `eye.Ka(eye==2)` , #> # `iov.Cl(occ==1)` , `iov.Cl(occ==2)` , `iov.Ka(occ==1)` , #> # `iov.Ka(occ==2)` , V2 , V3 , TCl , eta.Cl , #> # TKA , eta.Ka , Q , Kin , Kout , EC50 #> -- Initial Conditions ($inits): -- #> depot centr peri eff #> 0 0 0 1 #> #> Simulation with uncertainty in: #> * parameters ($thetaMat for changes) #> * omega matrix ($omegaList) #> #> -- First part of data (object): -- #> # A tibble: 976,000 x 21 #> sim.id id time inv.Cl inv.Ka eye.Cl eye.Ka iov.Cl iov.Ka C2 C3 #> [h] #> 1 1 1 0 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 0 0 #> 2 1 1 0.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 1.24 0.00724 #> 3 1 1 4 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 16.5 5.02 #> 4 1 1 4.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 32.3 5.15 #> 5 1 1 8 -0.0390 -0.0942 0.291 0.0726 0.0168 0.0267 21.8 8.35 #> 6 1 1 8.1 -0.0390 -0.0942 -0.0154 0.345 0.0168 0.0267 12.6 8.40 #> # i 975,994 more rows #> # i 10 more variables: CL , KA , ef0 , depot , centr , #> # peri , eff
## Sample homogenous Poisson process of rate 1/10
rxPp(10, 1 / 10)
-#> [1] 8.19983 13.67398 15.48588 17.26219 25.86169 46.25349 49.45993 51.13983
-#> [9] 60.37309 60.55272
+#> [1] 26.15775 33.38380 47.94631 54.17793 55.85722 66.26814 73.62000
+#> [8] 106.75224 116.90016 126.39661
## Sample inhomogenous Poisson rate of 1/10
rxPp(10, 1 / 10, gamma = 2, tmax = 100)
-#> [1] 29.84255 44.80297 48.41821 48.74108 62.10962 64.37036 65.37986 66.33762
-#> [9] 70.33763 90.42581
+#> [1] 19.01904 50.51773 52.22514 52.76671 57.93220 59.95101 63.86916 69.82497
+#> [9] 70.21448 70.65940
## Typically the Poisson process times are in a sequential order,
## using randomOrder gives the Poisson process in random order
rxPp(10, 1 / 10, gamma = 2, tmax = 10, randomOrder = TRUE)
-#> [1] 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000 10.0000000
-#> [7] 10.0000000 10.0000000 10.0000000 0.8339647
+#> [1] 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000
+#> [8] 10.000000 10.000000 6.122726
## This uses an arbitrary function to sample a non-homogenous Poisson process
rxPp(10, 1 / 10, prob = function(x) {
1/(1+abs(x))
})
-#> [1] 4.809088 5.063217 13.240161 67.763702 202.342912 401.974004
-#> [7] 491.820102 657.699603 663.916682 679.367688
+#> [1] 76.20239 136.99708 141.49227 242.51418 303.74927 442.45036 475.40954
+#> [8] 558.23538 591.07437 635.88796