Skip to content

Commit

Permalink
correct bf parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jsocolar committed Oct 3, 2023
1 parent 631d080 commit 96ce164
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/flock.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ flock_ <- function(output, f_occ, f_det, flocker_data, data2 = NULL,
}

if(brms::is.brmsformula(f_det)){
f_det_txt <- format(f_det$formula)
f_det_txt1 <- format(f_det$formula)
is_valid <- grepl("^det[[:blank:]]*~", f_det_txt)
assertthat::assert_that(
is_one_logical(is_valid),
Expand All @@ -224,6 +224,7 @@ flock_ <- function(output, f_occ, f_det, flocker_data, data2 = NULL,
"must be a detection formula beginning with `det ~`"
)
)
f_det_txt <- paste0("~", strsplit(f_det_txt1)[[1]][2])
} else {
f_det_txt <- paste0(deparse(f_det), collapse = "")
}
Expand Down

0 comments on commit 96ce164

Please sign in to comment.