# NOT RUN {
# remove all chunklabels except the one named 'setup'
temp_file_path <- file.path(tempdir(), "test1.Rmd")
file.copy(system.file("examples", "example4.Rmd", package = "namer"),
temp_file_path,
overwrite = TRUE)
unname_all_chunks(temp_file_path)
if(interactive()){
file.edit(temp_file_path)
}
# remove all chunk labels starting with 'example4'
temp_file_path <- file.path(tempdir(), "test2.Rmd")
file.copy(system.file("examples", "example4.Rmd", package = "namer"),
temp_file_path,
overwrite = TRUE)
unname_all_chunks(temp_file_path,chunk_name_prefix='example4')
if(interactive()){
file.edit(temp_file_path)
}
# }
Run the code above in your browser using DataLab