Get the roots from a vector with code paths

root_from_codePaths(x)

Arguments

x

A vector of code paths.

Value

A vector with the root of each element.

Examples

root_from_codePaths(
  c("codes>reason>parent_feels",
    "codes>reason>child_feels")
);
#> codes>reason>parent_feels  codes>reason>child_feels 
#>                   "codes"                   "codes"