# Example function that adds unstructured data to tools
MyTool <- function(object) {
sample.tool.output <- matrix(rnorm(n = 16), nrow = 4)
# Note: `Tool<-` must be called from within a function
# and the name of the tool will be generated from the function name
Tool(object) <- sample.tool.output
return(object)
}
# Run our tool
set.seed(42L)
pbmc_small <- MyTool(pbmc_small)
# Get a list of tools run
Tool(pbmc_small)
# Access specific tool data
Tool(pbmc_small, slot = "MyTool")
Run the code above in your browser using DataLab