Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 20, 2024
1 parent 696d4dd commit c55a28b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/find_terms.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ find_terms.mipo <- function(x, flatten = FALSE, ...) {

# protect "-1"
f$conditional <- gsub("(-1|- 1)(?![^(]*\\))", "#1", f$conditional, perl = TRUE)
f$response <- gsub("(-1|- 1)(?![^(]*\\))", "#1", f$response, perl = TRUE)

# This regular expression matches any of the characters *, +, :, |, -, or /,
# unless they are preceded by a ^ and followed by a closing parenthesis ).
Expand Down Expand Up @@ -239,7 +240,9 @@ find_terms.mipo <- function(x, flatten = FALSE, ...) {
trim_ws(unlist(strsplit(f$conditional[need_split], " ", fixed = TRUE), use.names = FALSE))
)
}

f$conditional <- gsub("#1", "-1", f$conditional, fixed = TRUE)
f$response <- gsub("#1", "-1", f$response, fixed = TRUE)

# reorder, so response is first
compact_list(f[c(length(f), 1:(length(f) - 1))])
Expand Down

0 comments on commit c55a28b

Please sign in to comment.