uncomment_marked_lines: Function to uncomment all commented-out lines.

Description Usage Arguments Value

View source: R/uncomment_marked_lines.R

Description

Sometimes commands which work on the client side do not work or are detrimental on your side. (Think install.packages lines, or file system commands.) This function takes an .R script file and uncomments any lines previously marked for uncommenting. Lines can be added to your version with a pattern e.g. ##UNCOMMENT##, and then removed when the code is shipped back to the client.

Usage

1
2
3
4
5
uncomment_marked_lines(
  file,
  new_file_name,
  uncomment_pattern = "##UNCOMMENT##$"
)

Arguments

file

character string with file path to .R file.

new_file_name

character string with file path (and name) for the output .R file.

uncomment_pattern

Regular expression for finding uncomment marker. Any lines containing this pattern are uncommented.

Value

If file runs cleanly, then output is TRUE.


danwkenn/ConsulR documentation built on Dec. 19, 2021, 8:11 p.m.