merge_nested: Merge nested data

Description Usage Arguments Details Examples

View source: R/exported.R

Description

Merges two Datavyu columns by onset/offset timestamps

Usage

1
merge_nested(outer_col, inner_col, ...)

Arguments

outer_col

top level column name as a character, (e.g., trial or block)

inner_col

bottom level column name as a character (e.g., eye gazes within trial)

...

additional parameters passed to import_datavyu().

Details

Since data is nested, this will repeat rows from the higher level data. If any cell in the lower level is not within a cell in the higher level, it will not be in the final data set. This function is to be used only with truly nested data. For finer control over potentially overlapping cells see temporal_align() with the option keep_frame_num=FALSE and a high value for fps for better precision in aligning timestamps.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# merge nested data, throwing away lower level cells that
# are not within higher level cells
merged <- merge_nested("childhands", "parenthands")

# another way to merge nested, but contains NAs for cells that are not
# fully within one another since these data are not nested, you can see how much
# is being thrown away compared to x
y <- temporal_align(
  columns=c("childhands", "parenthands"),
  fps=30,
  keep.frames=FALSE
)

## End(Not run)

iamamutt/datavyur documentation built on Dec. 20, 2021, 5:57 p.m.