Vectice R API cheat sheet

This API guide provides a quick overview of Vectice's simple R API calls to help you get started auto-documenting your datasets, models, and notes.

Be sure to create your API key first!

Install Vectice

Start by installing the Vectice library.

# Install reticulate if not already installed
install.packages("reticulate")

# Install the latest Vectice library
reticulate::py_install("vectice", pip = TRUE)

# Or install a specific version of Vectice
reticulate::py_install("vectice==<desired_version_number>", pip = TRUE)

Connect to Vectice

Get started by connecting to the Vectice API and starting an iteration.

#import and connect to Vectice
vectice <- reticulate::import("vectice")
connect <- vectice$connect(api_token="your-api-key") #Paste your API key

# Connect to your project phase using your phase ID
phase = connect$phase("PHA-XXX") #You can fetch the relevant phase ID from your chosen Vectice project in the app.

#Create an iteration
iteration <- phase$create_or_get_current_iteration()

Auto-document your assets

Auto-document your notes, datasets, and models directly to Vectice.

Auto-document NOTES

# Auto-document your first comments or notes
iteration$log("this is a comment")

Auto-document DATASETS

# Auto-document your first dataset from a local file
ds_resource <- vectice$FileResource(paths, dataframes)
raw_ds <- vectice$Dataset$origin(name=name, resource=ds_resource, attachments = attachments)
iteration$log(raw_ds)

Auto-document MODELS

# Auto-document your first model
model <- vectice$Model(library, technique, metrics, properties, name, attachments, predictor)
iteration$log(model)

Close your iteration

Once you are done logging your assets for an iteration, mark it complete.

# Completes and closes the current iteration once you are happy with it
iteration$complete()

Additional resources

Last updated