Description Usage Arguments Value
View source: R/remove_delete_lines.R
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.
1 | remove_delete_lines(file, new_file_name, delete_pattern = "##DELETE##$")
|
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. |
If file runs cleanly, then output is TRUE
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.