Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Cran fixes #19

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rxode2random
Title: Random Number Generation Functions for 'rxode2'
Version: 2.0.11.9001
Version: 2.0.12
Authors@R: c(
person("Matthew L.", "Fidler", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8538-6691")),
Expand All @@ -22,12 +22,12 @@ Imports:
Rcpp,
checkmate,
lotri,
rxode2parse (> 2.0.13)
rxode2parse (>= 2.0.17)
Suggests:
testthat (>= 3.0.0)
LinkingTo:
sitmo,
rxode2parse (>= 2.0.12),
rxode2parse (>= 2.0.17),
Rcpp,
RcppArmadillo,
BH
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rxode2random (development version)
# rxode2random 2.0.12

- Added function `dfWishart` which gives (by simulation) an
approximation of the degrees of freedom of a Wishart to match a
Expand All @@ -7,6 +7,9 @@
- Added function `swapMatListWithCube` which swaps omegaList with
omegaCube values

- Ensure that the outputs are integers (instead of long integers) as
requested by CRAN for some checking functions.

# rxode2random 2.0.11

- Fix qassert LTO
Expand Down
2 changes: 1 addition & 1 deletion R/dfWishart.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
.lower <- .d[1] + 3.1
.upper <- upper
rxWithSeed(seed, {
uniroot(dfWishartCalcRse, lower=.lower, upper=.upper, omega=omega, totN=totN, rse=rse, diag=diag)
stats::uniroot(dfWishartCalcRse, lower=.lower, upper=.upper, omega=omega, totN=totN, rse=rse, diag=diag)

Check warning on line 64 in R/dfWishart.R

View check run for this annotation

Codecov / codecov/patch

R/dfWishart.R#L64

Added line #L64 was not covered by tests
})
}
#' Swaps the matrix list with a cube
Expand Down
18 changes: 9 additions & 9 deletions R/rxrandom.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' `rxnorm` simulates using the threefry sitmo generator;
#'
#' @return normal random number deviates
#'
#'
#' @importFrom Rcpp sourceCpp
#' @importFrom stats setNames
#' @useDynLib rxode2random, .registration=TRUE
Expand Down Expand Up @@ -69,7 +69,7 @@
#' rxt(df = 3, n = 10, ncores = 2) # You can parallelize the simulation using openMP
#'
#' rxt(4) ## The first argument is the df parameter
#'
#'
#' @export
rxt <- function(df, n = 1L, ncores = 1L) {
checkmate::assertNumeric(df, len = 1, lower = 0)
Expand All @@ -94,7 +94,7 @@
#' rxunif(min = 0, max = 4, n = 10, ncores = 2) # You can parallelize the simulation using openMP
#'
#' rxunif()
#'
#'
#' @export
rxunif <- function(min = 0, max = 1, n = 1L, ncores = 1L) {
checkmate::assertNumeric(min, len = 1)
Expand Down Expand Up @@ -708,10 +708,10 @@
#' `omega` matrix of standard deviations
#'
#' @param omegaIsChol is an indicator of if the omega matrix is in
#' the Cholesky decomposition. This is only used when code{type="invWishart"}
#' the Cholesky decomposition. This is only used when \code{type="invWishart"}
#'
#' @param returnChol Return the Cholesky decomposition of the
#' covariance matrix sample. This is only used when code{type="invWishart"}
#' covariance matrix sample. This is only used when \code{type="invWishart"}
#'
#' @param diagXformType Diagonal transformation type. These could be:
#'
Expand Down Expand Up @@ -1039,11 +1039,11 @@
#'
#' @return md5 hash of rxode2random revision
#' @author Matthew L. Fidler
#' @export
#' @export
#' @examples
#' rxode2randomMd5()
rxode2randomMd5 <- function() {
rxode2random.md5
rxode2random.md5

Check warning on line 1046 in R/rxrandom.R

View check run for this annotation

Codecov / codecov/patch

R/rxrandom.R#L1046

Added line #L1046 was not covered by tests
}


Expand Down Expand Up @@ -1072,13 +1072,13 @@

#' Expand parameters
#'
#'
#'
#' @param object rxode2 model variables object
#' @param params parameters to expand
#' @param events event table to help with the expansion
#' @param control control structure to help with the parameter generation
#' @return Expanded parameters for simulation
#' @export
#' @export
#' @author Matthew L. Fidler
#' @keywords internal
.expandPars <- function(object, params, events, control) {
Expand Down
12 changes: 12 additions & 0 deletions R/zzzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.rxode2parseVersion <- utils::packageVersion("rxode2parse")
.onLoad <- function(libname, pkgname) {
if (!identical(.rxode2parseVersion, utils::packageVersion("rxode2parse"))) {
stop("rxode2 compiled with rxode2parse '", as.character(.rxode2parseVersion),
"' but rxode2parse '", as.character(utils::packageVersion("rxode2parse")),
"' is loaded\nRecompile rxode2 with the this version of rxode2parse",
call. = FALSE

Check warning on line 7 in R/zzzz.R

View check run for this annotation

Codecov / codecov/patch

R/zzzz.R#L3-L7

Added lines #L3 - L7 were not covered by tests
)
} else {
requireNamespace("rxode2parse", quietly=TRUE)

Check warning on line 10 in R/zzzz.R

View check run for this annotation

Codecov / codecov/patch

R/zzzz.R#L10

Added line #L10 was not covered by tests
}
}
4 changes: 2 additions & 2 deletions man/cvPost.Rd

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

2 changes: 1 addition & 1 deletion man/invWR1d.Rd

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

12 changes: 6 additions & 6 deletions src/checkmate_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@
R_xlen_t pos = find_missing_string(nn);
if (pos > 0) {
UNPROTECT(1);
Rf_errorcall(R_NilValue, "Must have %s, but is NA at position %i", what, pos);
Rf_errorcall(R_NilValue, "Must have %s, but is NA at position %i", what, (int)(pos));

Check warning on line 44 in src/checkmate_stub.c

View check run for this annotation

Codecov / codecov/patch

src/checkmate_stub.c#L44

Added line #L44 was not covered by tests
}
pos = any_duplicated(nn, FALSE);

if (pos > 0) {
UNPROTECT(1);
Rf_errorcall(R_NilValue, "Must have unique %s, but element %i is duplicated", what, pos);
Rf_errorcall(R_NilValue, "Must have unique %s, but element %i is duplicated", what, (int)(pos));

Check warning on line 50 in src/checkmate_stub.c

View check run for this annotation

Codecov / codecov/patch

src/checkmate_stub.c#L50

Added line #L50 was not covered by tests
}

if (isNull(nn)) {
UNPROTECT(1);
Rf_errorcall(R_NilValue, "Must have %s", what);
}
pos = any_duplicated(nn, FALSE);
if (pos > 0){
UNPROTECT(1);
Rf_errorcall(R_NilValue, "Must have unique %s, but element %i is duplicated", what, pos);
Rf_errorcall(R_NilValue, "Must have unique %s, but element %i is duplicated", what, (int)(pos));

Check warning on line 60 in src/checkmate_stub.c

View check run for this annotation

Codecov / codecov/patch

src/checkmate_stub.c#L60

Added line #L60 was not covered by tests
}
pos = check_strict_names(nn);
if (pos > 0){
UNPROTECT(1);
Rf_errorcall(R_NilValue, "Must have %s according to R's variable naming conventions, but element %i does not comply", what, pos);
Rf_errorcall(R_NilValue, "Must have %s according to R's variable naming conventions, but element %i does not comply", what, (int)(pos));

Check warning on line 65 in src/checkmate_stub.c

View check run for this annotation

Codecov / codecov/patch

src/checkmate_stub.c#L65

Added line #L65 was not covered by tests
}
UNPROTECT(1);
}
Expand Down
Loading