Learn R Programming

gooseR (version 0.1.2)

goose_give_sample: 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)

Value

Invisible NULL. Prints object summary and saves to memory.

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)

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab