goose_give_sample: Share R Object Structure with Goose

View source: R/goose_essentials.R

goose_give_sampleR Documentation

Share R Object Structure with Goose

Description

Captures the structure and sample values of an R object and saves it in a format that Goose can understand and reference when providing code. This enables Goose to write accurate code that references actual column names and understands data types.

Usage

goose_give_sample(object, name = NULL, rows = 5, save_to_memory = TRUE)

Arguments

object

An R object (data.frame, matrix, tibble, list, etc.)

name

Optional custom name for the object. Defaults to the object's name.

rows

Number of sample rows to include (default: 5)

save_to_memory

Whether to save to Goose memory (default: TRUE)

Value

Invisible NULL. Prints object summary and saves to memory.

Examples

## Not run: 
# Share a data frame with Goose
goose_give_sample(mtcars)

# Share with custom name
goose_give_sample(iris, "flower_data")

# Share just structure without saving
goose_give_sample(my_model, save_to_memory = FALSE)

## End(Not run)


gooseR documentation built on Feb. 6, 2026, 5:07 p.m.