You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V.minor - several usethis functions print an extra escape backslash character in their R output compared to what they say they have written in file
#2095
Closed
remlapmot opened this issue
Jan 23, 2025
· 1 comment
This is super minor but I notice that several usethis functions print an extra escape backslash in the R console compared to what they claim they have written in a file.
Here’s a reprex.
library(usethis)
file.remove(".Rbuildignore")
#> [1] TRUE
use_github_action("check-standard.yaml")
#> ✔ Setting active project to "/Users/eptmp/Documents/GitHub/usethis-reprex".#> ✔ Adding "^\\.github$" to '.Rbuildignore'.#> ✔ Saving "r-lib/actions/examples/check-standard.yaml@v2" to#> '.github/workflows/R-CMD-check.yaml'.#> ☐ Learn more at <https://github.com/r-lib/actions/blob/v2/examples/README.md>.#> ☐ Copy and paste the following lines into 'README.md':#> <!-- badges: start -->#> [![R-CMD-check](https://github.com/remlapmot/usethis-reprex/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/remlapmot/usethis-reprex/actions/workflows/R-CMD-check.yaml)#> <!-- badges: end -->
cat(paste0(readLines(".Rbuildignore"), collapse="\n"))
#> ^\.github$
i.e., the R console prints that ^\\.github$ has been written to .Rbuildignore but in fact ^\.github$ is written in the file.
The create_package() function also does this, there might be others - I haven’t checked all functions.
I think you are reacting to the way strings print in R, i.e. that the escapes are visible in the printed string, but they are not actually present in the string:
This is super minor but I notice that several usethis functions print an extra escape backslash in the R console compared to what they claim they have written in a file.
Here’s a reprex.
i.e., the R console prints that
^\\.github$
has been written to .Rbuildignore but in fact^\.github$
is written in the file.The
create_package()
function also does this, there might be others - I haven’t checked all functions.Created on 2025-01-23 with reprex v2.1.1
Session info
The text was updated successfully, but these errors were encountered: