Skip to contents

return the experimental cells that are in a model term as a table

This function extracts cells from an event_factor object, optionally removing empty cells. Note that the removal of empty cells is not implemented.

This function extracts cells from an event_term object, optionally removing empty cells.

Usage

cells(x, ...)

# S3 method for event_factor
cells(x, drop.empty = TRUE, ...)

# S3 method for event_term
cells(x, drop.empty = TRUE, ...)

# S3 method for covariate_convolved_term
cells(x, ...)

Arguments

x

An event_term object.

...

Additional arguments to be passed to the function.

drop.empty

Logical. If TRUE, empty cells will be removed.

Value

A list of data frames containing the cells of the event_factor object.

A tibble containing the cells of the event_term object, with an additional "count" attribute.

Examples


evlist <- list(fac1=factor(c("A", "B", "A", "B")), 
               fac2=factor(c("1", "1", "2", "2")))
eterm <- event_term(evlist,onsets=1:4, blockids=rep(1,4))
cells(eterm)
#> # A tibble: 4 × 2
#>   fac1  fac2 
#>   <fct> <fct>
#> 1 A     1    
#> 2 B     1    
#> 3 A     2    
#> 4 B     2