
Verify Write Mode is Enabled (Guard Function)
improveEditable.RdChecks that the session is both connected to the improve repository AND has write mode enabled. Stops with an error if either condition is not met. Use this as a guard at the start of functions that modify repository content.
Value
Invisibly returns TRUE if both conditions are met. Throws an error
with a descriptive message if:
Not connected to the repository (calls
improveConnected)Connected but write mode is not enabled
Details
This function serves as a guard clause for write operations. It ensures that:
improveConnecthas been called successfullysetEditable(TRUE)has been called to enable write mode
Package functions that modify repository content should call this function at their start to fail fast with a clear error message rather than failing later with an ambiguous API error.
See also
setEditable to enable write mode,
improveConnected to check connection only
Examples
if (FALSE) { # \dontrun{
# This function is typically used inside other functions:
my_write_function <- function(path, data) {
improveEditable() # Guard: stops if not connected or not editable
# ... perform write operations ...
}
# Direct usage to check write capability:
improveConnect()
setEditable(TRUE)
improveEditable() # Passes silently
} # }