Generic function for drawing a random sample from an object.
For objects of class IssuesTB, this method returns a random subset of the issues.
sample(x, size, replace = FALSE, prob = NULL)
# S3 method for class 'IssuesTB'
sample(x, size = nrow(x), replace = FALSE, prob = NULL)
# Default S3 method
sample(x, size, replace = FALSE, prob = NULL)For IssuesTB objects, an object of the same class containing the
sampled issues.
For all other objects, the result of base::sample().
The arguments and overall behavior are consistent with base::sample().
For details about the sampling algorithm, probability weights, and special
cases, refer to the original documentation:
https://stat.ethz.ch/R-manual/R-devel/library/base/html/sample.html
issues_selector <- init_selector(
source = "Local",
file = file.path(
system.file("data_issues", package = "IssueTrackeR"),
"list_issues.yaml"
)
)
open_issues <- get_issues(selector = issues_selector)
#> The issues will be read from /home/runner/work/_temp/Library/IssueTrackeR/data_issues/list_issues.yaml.
new_issues <- sample(open_issues, size = 5L)