Skip to contents

Enhanced version of .sn_get_example_value that can optionally create temporary mock files for realistic examples in documentation and help.

Usage

sn_get_example_value_with_mockdata(
  datatype,
  param_name = NULL,
  tool_name = NULL,
  input_output = "input",
  create_temp_file = FALSE,
  temp_dir = NULL,
  size = "minimal"
)

Arguments

datatype

Character. The datatype name.

param_name

Character. The parameter name (for context-aware examples).

tool_name

Character. Optional tool name for tool-specific datatypes.

input_output

Character. Whether this is for "input" or "output".

create_temp_file

Logical. Whether to create actual temporary mock files.

temp_dir

Character. Directory for temporary files (default: tempdir()).

size

Character. Size category for mock data generation.

Value

Character string with example value (path to temp file if create_temp_file=TRUE).

Examples

if (FALSE) { # \dontrun{
# Get regular example value
sn_get_example_value_with_mockdata("fasta")

# Create temporary mock file and return its path
temp_fasta <- sn_get_example_value_with_mockdata("fasta",
  param_name = "reference", create_temp_file = TRUE
)

# Use in tool demonstration
temp_fastq <- sn_get_example_value_with_mockdata("fastq",
  param_name = "input1", create_temp_file = TRUE, size = "small"
)
} # }