extract_comment | R Documentation |
Vectorize all comments from the file
extract_comment(file)
remove_content_in_quotes(line)
remove_comment(line)
clean_file(file, output_file)
get_func_def(file)
file |
file to parse |
line |
string vector to remove contents within quotes or comments |
output_file |
file path to write the output of the new file |
vector of all comments within a file
## Not run:
ex_file1 <- "path/file1.R"
# get all comments
cmmts <- extract_comment(ex_file1)
cmmts
## End(Not run)
## Not run:
# Ex to clean out comments from file
file_path <- ".testR"
output_file_path <- ".cleaned_script.R"
clean_file(file_path, output_file_path)
## End(Not run)
# example code
## Not run:
# Ex to get all defined functions
# within a file
file_path <- ".testR"
get_func_def(file_path)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.