- Notifications
You must be signed in to change notification settings - Fork10
R package 📦 for labelling chunks of RMarkdown files! 💥
License
Unknown, MIT licenses found
Licenses found
jumpingrivers/namer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The goal of {namer} is to name the chunks of R Markdown files. It’s yoursafety net when you’ve (willingly) forgotten to name most chunks of allR Markdown files in a folder. {namer} doesnot give meaningful labelsto your chunks, but it gives them labels that won’t change depending ontheir position like the automaticknitr:::unnamed_chunk function doeswhen knitting. So you can e.g. shuffle your chunks and not loose theircache, or more easily debug over a whole folder!
For context aboutwhy you should name your R Markdown chunks, readthis blog post.
The screenshot below isa real lifeexample, resultof runningnamer::name_dir_chunks("pres"). In each of the files in thedir “pres”, it labelled chunks using the filename and numbers.
This is a basic example which shows you how to solve a common problem.The “test” folder first contains R Markdown files with unnamed chunks.After runningname_dir_chunks, they’re all named, with names using thefilenames as basis.
fs::dir_copy(system.file("examples",package="namer"),"test")name_dir_chunks("test")file.edit("test/example1.Rmd")
There’s alsoname_chunks() for use on a single R Markdown file; andunname_chunks() to unname all chunks of a single R Markdown file aswell asunname_dir_chunks() to unname all chunks of all R Markdownfiles in a directory, which can be useful when cleaning your chunklabels.
By defaultunname_chunks() unnames all chunks with exception of the‘setup’ chunk. By using the argumentchunk_name_prefix one canindicate the prefix of the labels that will be unnamed. Useful when onerefers to a label by using chunk optionref.label so that it isinconvenient when that label is unnamed. By settingchunk_name_prefixequal to ‘the filename with extension stripped’ followed with a ‘-’(dash) only the labels generated byname_chunks() will be unnamed.
If you’re working with RStudio, installing the package will haveinstalled an addin for labelling chunks ofany R Markdown document youselect.
When using {namer}, please check the edits before pushing them to yourcode base. Such automatic chunk labelling is best paired withversioncontrol.
Install {namer} from CRAN
install.packages("namer")Or get the dev version from this repo using:
remotes::install_github("jumpingrivers/namer")
Please note that the namer project is released with aContributor Codeof Conduct.By contributing to this project, you agree to abide by its terms.
Maintained byJumping Rivers
About
R package 📦 for labelling chunks of RMarkdown files! 💥
Topics
Resources
License
Unknown, MIT licenses found
Licenses found
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors12
Uh oh!
There was an error while loading.Please reload this page.
