remove_delete_lines: Remove lines marked for deletion Simple function to take an...

Description Usage Arguments Value

View source: R/remove_delete_lines.R

Description

Remove lines marked for deletion Simple function to take an .R script file and remove any lines previously marked for deletion. This is useful when your computer requires additional lines for the client's code to work. Lines can be added to your version with a pattern e.g. ##DELETE##, and then removed when the code is shipped back to the client. It should be noted that this is not an ideal solution, and if possible, the use of an R Project file, or compilation of code into an R package should be used to ensure code can be used on multiple machines. Another use might be to add comments to your version of the code that the client does not need to read.

Usage

1
remove_delete_lines(file, new_file_name, delete_pattern = "##DELETE##$")

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.

delete_pattern

Regular expression for finding delete marker. Any lines containing this pattern are removed.

Value

If file runs cleanly, then output is TRUE.


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