goose_save: Save R Object to Goose Memory

View source: R/memory.R

goose_saveR Documentation

Save R Object to Goose Memory

Description

Save an R object to Goose's memory system with optional tags and category. Objects are serialized to RDS format and metadata is stored in Goose's text format.

Usage

goose_save(
  object,
  name,
  category = "r_objects",
  tags = NULL,
  description = NULL,
  global = TRUE,
  overwrite = FALSE
)

Arguments

object

The R object to save (can be any R object: data.frame, model, list, etc.)

name

Character string. Name for the saved object (will be used as filename)

category

Character string. Category for organizing memories (default: "r_objects")

tags

Character vector. Optional tags for searching/filtering

description

Character string. Optional description of the object

global

Logical. If TRUE (default), saves to global Goose memory. If FALSE, saves to project-local memory.

overwrite

Logical. If TRUE, overwrites existing object. If FALSE (default), errors if object exists.

Value

Invisibly returns the path where the object was saved

Examples

## Not run: 
# Save a model
model <- lm(mpg ~ wt, data = mtcars)
goose_save(model, "mtcars_model", 
           category = "models",
           tags = c("regression", "mtcars"),
           description = "Linear model predicting mpg from weight")

# Save a data frame
goose_save(iris, "iris_data", 
           category = "datasets",
           tags = "example")

## End(Not run)

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