Extract the nth issue from a IssuesTB object.

extract_nth(x, n, verbose)

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

# Default S3 method
extract_nth(...)

Arguments

x

An object of class IssuesTB.

n

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

verbose

A logical value indicating whether to print additional information. Default is TRUE.

...

Currently not used.

Value

The nth issue as a IssueTB object. If n exceeds the number of issues, returns the last issue with a warning. Returns NULL if the issues list is empty.

Examples

all_issues <- get_issues(
    source = "local",
    dataset_dir = system.file("data_issues", package = "IssueTrackeR"),
    dataset_name = "open_issues.yaml"
)
#> Looking into open_issues.yaml ...
#> The issues will be read from /home/runner/work/_temp/Library/IssueTrackeR/data_issues/open_issues.yaml.

first_issue <- extract_nth(all_issues, 1)
#> The 1th issue will be extracted.
third_issue <- extract_nth(all_issues, 3)
#> The 3th issue will be extracted.