gdataset.example_path: Create an example dataset on the fly

View source: R/dataset.R

gdataset.example_pathR Documentation

Create an example dataset on the fly

Description

Creates a small dataset in a temporary directory using the built-in example database. This function has side effects: it calls gdb.init_examples which resets the working database, and it creates then deletes temporary tracks ('example_dataset_track') and intervals ('example_dataset_intervals') in that database.

Usage

gdataset.example_path()

Details

This function performs the following steps:

  1. Calls gdb.init_examples() to set the working database

  2. Removes any existing 'example_dataset_track' and 'example_dataset_intervals'

  3. Creates temporary track and intervals in the example database

  4. Saves them to a new dataset in a temporary directory

  5. Removes the temporary track and intervals from the example database

This is primarily intended for use in examples and tests. Users should be aware that calling this function will change their current working database.

Value

Path to the created dataset directory (in a temporary location)

See Also

gdataset.save, gdataset.load, gdb.init_examples

Examples



dataset_path <- gdataset.example_path()
gdataset.load(dataset_path)
gdataset.unload(dataset_path)


misha documentation built on Jan. 28, 2026, 1:07 a.m.