Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rename_files

Automatically rename paired R/ and test/ files


Description

  • Moves R/{old}.R to R/{new}.R

  • Moves tests/testthat/test-{old}.R to tests/testthat/test-{new}.R

  • Moves tests/testthat/test-{old}-*.* to tests/testthat/test-{new}-*.* and updates paths in the test file.

  • Removes context() calls from the test file, which are unnecessary (and discouraged) as of testthat v2.1.0.

This is a potentially dangerous operation, so you must be using Git in order to use this function.

Usage

rename_files(old, new)

Arguments

old, new

Old and new file names (with or without extensions).


usethis

Automate Package and Project Setup

v2.0.1
MIT + file LICENSE
Authors
Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.