Call this function as an add-in to enclose selected text with percent operator %.

rs_enclose_with_percent(context = rs_get_context())

Arguments

context

(class document_context)
Object with context of active RStudio document.