Remove the nth issue from a IssuesTB object or the nth selector from a SelectorTB object.

remove_nth(x, ...)

# S3 method for class 'IssuesTB'
remove_nth(x, n, verbose = TRUE, ...)

# S3 method for class 'SelectorTB'
remove_nth(x, n, verbose = TRUE, ...)

# Default S3 method
remove_nth(...)

Arguments

x

An object of class IssuesTB or SelectorTB.

...

Currently not used.

n

Integer. Position of the element to remove. 1 is for the first element.

verbose

Boolean indicating whether to print additional information.

Value

If x is a IssuesTB, it returns the list of issues (a IssuesTB object) without the nth issue. If x is a SelectorTB, it returns the list of selector (a SelectorTB object) without the nth selector If n exceeds the number of issues or selector, returns the initial list with a warning.

Examples

issues_selector <- init_selector(
    source = "Local",
    dataset_dir = system.file("data_issues", package = "IssueTrackeR"),
    dataset_name = NULL
)
my_issues <- get_issues(selector = issues_selector)
#> The issues will be read from /home/runner/work/_temp/Library/IssueTrackeR/data_issues/list_issues.yaml.
issues_wo_1 <- remove_nth(my_issues, 1)
#> The 1th issue will be removed
issues_wo_3 <- remove_nth(my_issues, 3)
#> The 3th issue will be removed