Skip to content
Open
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
11 changes: 7 additions & 4 deletions R/hrf-afni.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ afni_hrf <- function(..., basis=c("spmg1", "block", "dmblock",
start=NULL, stop=NULL) {

## TODO cryptic error message when argument is mispelled and is then added to ...
basis <- tolower(basis)
basis <- tolower(basis)[1]
if (basis == "sin") basis <- "sine"
if (basis == "gam") basis <- "gamma"
basis <- match.arg(basis)
basis <- match.arg(basis,
c("spmg1", "block", "dmblock", "tent", "csplin",
"poly", "sine", "gamma", "spmg2", "spmg3", "wav"))

vars <- as.list(base::substitute(list(...)))[-1]
# Convert raw expressions to quosures for compatibility with construct_event_term
Expand Down Expand Up @@ -143,9 +145,10 @@ afni_trialwise <- function(label, basis=c("spmg1", "block", "dmblock", "gamma",
precision = 0.3, summate = TRUE) {

## TODO cryptic error message when argument is mispelled and is then added to ...
basis <- tolower(basis)
basis <- tolower(basis)[1]
if (basis == "gam") basis <- "gamma"
basis <- match.arg(basis)
basis <- match.arg(basis,
c("spmg1", "block", "dmblock", "gamma", "wav"))

hrf <- if (!is.null(durations)) {
assert_that(length(durations) == 1, msg="afni_trialwise does not currently accept variable durations")
Expand Down
Loading