write: Save datasets in a yaml file

write_to_datasetR Documentation

Save datasets in a yaml file

Description

Save datasets in a yaml file

Usage

write_to_dataset(x, ...)

## S3 method for class 'IssuesTB'
write_to_dataset(
  x,
  dataset_dir = getOption("IssueTrackeR.dataset.dir"),
  dataset_name = "list_issues.yaml",
  verbose = TRUE,
  ...
)

## S3 method for class 'LabelsTB'
write_to_dataset(
  x,
  dataset_dir = getOption("IssueTrackeR.dataset.dir"),
  dataset_name = "list_labels.yaml",
  verbose = TRUE,
  ...
)

## S3 method for class 'MilestonesTB'
write_to_dataset(
  x,
  dataset_dir = getOption("IssueTrackeR.dataset.dir"),
  dataset_name = "list_milestones.yaml",
  verbose = TRUE,
  ...
)

## Default S3 method:
write_to_dataset(x, ...)

Arguments

x

an object of class IssuesTB, LabelsTB or MilestonesTB.

...

Unused parameter.

dataset_dir

A character string specifying the path which contains the datasets (only taken into account if source is set to "local"). Defaults to the package option IssueTrackeR.dataset.dir.

dataset_name

A character string specifying the name of the datasets which will be written (only taken into account if source is set to "local"). Defaults to "open_issues.yaml".

verbose

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

Details

Depending on the object, the defaults value of the argument dataset_name (by default) is:

  • "list_issues.yaml" for issues;

  • "list_labels.yaml" for labels;

  • "list_milestones.yaml" for milestones.

Value

invisibly (with invisible()) TRUE if the export was successful and an error otherwise.

Examples

path <- system.file("data_issues", package = "IssueTrackeR")
issues <- get_issues(
    source = "local",
    dataset_dir = path,
    dataset_name = "open_issues.yaml"
)
milestones <- get_milestones(
    source = "local",
    dataset_dir = path,
    dataset_name = "list_milestones.yaml"
)
labels <- get_labels(
    source = "local",
    dataset_dir = path,
    dataset_name = "list_labels.yaml"
)

write_to_dataset(x = issues, dataset_dir = tempdir())
write_to_dataset(x = labels, dataset_dir = tempdir())
write_to_dataset(x = milestones, dataset_dir = tempdir())

write_to_dataset(x = issues, dataset_dir = tempdir(),
                 dataset_name = "my_issues")
write_to_dataset(x = labels, dataset_dir = tempdir(),
                 dataset_name = "my_labels")
write_to_dataset(x = milestones, dataset_dir = tempdir(),
                 dataset_name = "my_milestones")


IssueTrackeR documentation built on June 21, 2026, 1:07 a.m.