find_tag: Find Index of Tag in List of Tags

View source: R/filtering.R

find_tagR Documentation

Find Index of Tag in List of Tags

Description

Finds the index of a particular tag in a list of tags wherein the list might also contain vectors. This function helps to find row indices for later filtering functions.

Usage

find_tag(tag_list, tag)

Arguments

tag_list

A list of strings or vectors of strings representing tasks' tags (with vectors for tasks with multiple tags).

tag

Simple string of one tag to find in the tag_list.

Value

A boolean vector for the list indices that contain tag.

Examples

todo <- c('x 2018-12-12 2018-12-10 x y z @home +list',
          '(A) 2018-12-10 a b c @home @work',
          '2018-12-12 def +list',
          'a b c @context +list +project')
parse_tasks(todo) %>% filter(find_tag(context, '@home'))


paullemmens/todoRtxt documentation built on May 19, 2023, 3:21 p.m.