# Load a previously saved charisma object
obj <- system.file("extdata", "Tangara_fastuosa.RDS", package = "charisma")
obj <- readRDS(obj)
if (FALSE) {
# Examples that require objects with merge/replacement states
# (These examples show the syntax but won't run with the provided test data)
# Revert to a specific merge state (if merge states exist)
if (length(obj$merge_states) >= 2) {
result <- charisma2(obj, which.state = "merge", state.index = 2)
}
# Revert to a specific replacement state (if replacement states exist)
if (length(obj$replacement_states) >= 1) {
result <- charisma2(obj, which.state = "replace", state.index = 1)
}
# Re-enter interactive mode with original threshold
obj <- system.file("extdata", "Tangara_fastuosa.RDS", package = "charisma")
obj <- readRDS(obj)
result <- charisma2(obj, interactive = TRUE)
}
Run the code above in your browser using DataLab