RStudio add-in to insert selected lines into code block:

  • rmd_code_block() - verbatim code block;

  • rmd_code_block_r() - R code block.

. rmd_code_block_r_split() - splits block of R code.

These functions internally use function rs_enclose_all_with_lines() - that adds lines above and below the selection.

rmd_code_block_r()

rmd_code_block()

rmd_code_block_r_split()

See also

Other R Markdown formatting add-ins: format_rmd, rmd_equations, rmd_list