From 580c2a88eeb61e5cd41f6b617b9c510045bed12f Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Sun, 5 Nov 2023 07:51:43 -0600 Subject: [PATCH] CF fixes --- R/symengine.R | 8 ++++---- R/ui.R | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/symengine.R b/R/symengine.R index 03c649e1e..b15c31253 100644 --- a/R/symengine.R +++ b/R/symengine.R @@ -1392,7 +1392,7 @@ rxToSE <- function(x, envir = NULL, progress = FALSE, call. = FALSE ) } else if (length(.ret0) == length(.f)) { - if (is.environment(envir)){ + if (is.environment(envir)) { assign(.fun, .rxFunction(.fun), envir = envir) } .ret0 <- unlist(.ret0) @@ -3390,7 +3390,7 @@ rxSupportedFuns <- function() { .rxFun2cIf <- function(x, envir) { .logic <- .rxFun2c(x[[2]], envir=envir) .pre <- paste0(rep(" ", envir$n), collapse="") - .ret <- paste(.pre, "if (", .logic, ") "); + .ret <- paste(.pre, "if (", .logic, ") ") .ret <- paste0(.ret, .rxFun2c(x[[3]], envir=envir)) if (length(x) == 3) { @@ -3446,7 +3446,7 @@ rxSupportedFuns <- function() { identical(x[[1]], quote(`>=`)) || identical(x[[1]], quote(`!=`)) || identical(x[[1]], quote(`!`)) - ){ + ) { return(.rxFun2cLogic(x, envir=envir)) } else if (identical(x[[1]], quote(`*`)) || identical(x[[1]], quote(`**`)) || @@ -3595,7 +3595,7 @@ rxFun2c <- function(fun, name, onlyF=FALSE) { .s <- rxS(.body) .lastValue <- .s$rxLastValue return(c(list(.ret), - lapply(.env$args, function(v){ + lapply(.env$args, function(v) { .v <- symengine::D(.lastValue, symengine::S(v)) .v <- paste0("function(", paste(.env$args, collapse=", "), ") {\n", rxOptExpr(paste0("rxLastValue=", rxFromSE(.v)), msg=paste0("d(", .funName, ")/d(", v, ")")), "\nrxLastValue}") diff --git a/R/ui.R b/R/ui.R index 6ca4df956..a3c91cf2a 100644 --- a/R/ui.R +++ b/R/ui.R @@ -276,7 +276,7 @@ model <- function(x, ..., append=FALSE, auto=getOption("rxode2.autoVarPiping", T cov=NULL, envir=parent.frame()) { if (is(substitute(x), "{")) { .funName <- try(as.character(as.list(with(envir, match.call()))[[1]]), silent=TRUE) - if (inherits(.funName, "try-error")){ + if (inherits(.funName, "try-error")) { .funName <- NULL } else if (length(.funName) == 1L && exists(.funName, envir=parent.env(envir))) { rxode2parse::.udfEnvSet(parent.env(envir))