name_regions_in_subset: Assign meaningful region names to a subset of data with a...

Description Usage Arguments Value

View source: R/helper_functions.R

Description

A helper function to assign region names to a single type of stimuli. If data only has one stimuli, this function is called directly to assign region names; otherwise, it is called repeatedly for each subset of data corresponding to a stimuli type.

Usage

1
2
name_regions_in_subset(dat, reg.names, region.col, reg.names.col = reg.name,
  missing.prefix = "Reg_")

Arguments

dat

data.frame to add region names to

reg.names

named character vector, where names correspond to the new region names to be assigned, and the values correspond to current region identifiers

region.col

unquoted name of the column containing current region identifiers

reg.names.col

unquoted name of the coumn with region names which will be added to the data; "reg.name" by default

missing.prefix

what to prefix to region identifiers for which the user didn't specify names explicitly. Defaults to "Reg_", i.e. if region identifiers are numbers, it would generate something like "Reg_1".

Value

data.frame with the added reg.name column


antonmalko/ettools documentation built on May 28, 2019, 3:35 p.m.