Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Mar 1, 2024
1 parent db3c536 commit 9143717
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Most `use_*()` functions operate on the *active project*: literally, a directory

A few usethis functions have no strong connections to projects and will expect you to provide a path.

usethis is quite chatty, explaining what it's doing and assigning you tasks. `βœ”` indicates something usethis has done for you. `●` indicates that you'll need to do some work yourself.
usethis is quite chatty, explaining what it's doing and assigning you tasks. `βœ”` indicates something usethis has done for you. `☐` indicates that you'll need to do some work yourself.

Below is a quick look at how usethis can help to set up a package. But remember, many usethis functions are also applicable to analytical projects that are not packages.

Expand Down
66 changes: 34 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A few usethis functions have no strong connections to projects and will
expect you to provide a path.

usethis is quite chatty, explaining what it’s doing and assigning you
tasks. `βœ”` indicates something usethis has done for you. `●` indicates
tasks. `βœ”` indicates something usethis has done for you. `☐` indicates
that you’ll need to do some work yourself.

Below is a quick look at how usethis can help to set up a package. But
Expand All @@ -61,10 +61,10 @@ library(usethis)
# Create a new package -------------------------------------------------
path <- file.path(tempdir(), "mypkg")
create_package(path)
#> βœ” Creating '/tmp/RtmpPqIkgo/mypkg/'
#> βœ” Setting active project to '/private/tmp/RtmpPqIkgo/mypkg'
#> βœ” Creating 'R/'
#> βœ” Writing 'DESCRIPTION'
#> βœ” Creating '/tmp/Rtmp7yJh5e/mypkg/'.
#> βœ” Setting active project to "/private/tmp/Rtmp7yJh5e/mypkg".
#> βœ” Creating 'R/'.
#> βœ” Writing 'DESCRIPTION'.
#> Package: mypkg
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
Expand All @@ -76,54 +76,56 @@ create_package(path)
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.3.1
#> βœ” Writing 'NAMESPACE'
#> βœ” Setting active project to '<no active project>'
#> βœ” Writing 'NAMESPACE'.
#> βœ” Setting active project to "<no active project>".
# only needed since this session isn't interactive
proj_activate(path)
#> βœ” Setting active project to '/private/tmp/RtmpPqIkgo/mypkg'
#> βœ” Changing working directory to '/tmp/RtmpPqIkgo/mypkg/'
#> βœ” Setting active project to "/private/tmp/Rtmp7yJh5e/mypkg".
#> βœ” Changing working directory to '/tmp/Rtmp7yJh5e/mypkg/'

# Modify the description ----------------------------------------------
use_mit_license("My Name")
#> βœ” Adding 'MIT + file LICENSE' to License
#> βœ” Writing 'LICENSE'
#> βœ” Writing 'LICENSE.md'
#> βœ” Adding '^LICENSE\\.md$' to '.Rbuildignore'
#> βœ” Adding "MIT + file LICENSE" to 'License'.
#> βœ” Writing 'LICENSE'.
#> βœ” Writing 'LICENSE.md'.
#> βœ” Adding "^LICENSE\\.md$" to '.Rbuildignore'.

use_package("ggplot2", "Suggests")
#> βœ” Adding 'ggplot2' to Suggests field in DESCRIPTION
#> β€’ Use `requireNamespace("ggplot2", quietly = TRUE)` to test if package is installed
#> β€’ Then directly refer to functions with `ggplot2::fun()`
#> βœ” Adding ggplot2 to 'Suggests' field in DESCRIPTION.
#> ☐ Use `requireNamespace("ggplot2", quietly = TRUE)` to test if package is
#> installed.
#> ☐ Then directly refer to functions with `ggplot2::fun()`.

# Set up other files -------------------------------------------------
use_readme_md()
#> βœ” Writing 'README.md'
#> β€’ Update 'README.md' to include installation instructions.
#> βœ” Writing 'README.md'.
#> ☐ Update 'README.md' to include installation instructions.

use_news_md()
#> βœ” Writing 'NEWS.md'
#> βœ” Writing 'NEWS.md'.

use_test("my-test")
#> βœ” Adding 'testthat' to Suggests field in DESCRIPTION
#> βœ” Adding '3' to Config/testthat/edition
#> βœ” Creating 'tests/testthat/'
#> βœ” Writing 'tests/testthat.R'
#> βœ” Writing 'tests/testthat/test-my-test.R'
#> β€’ Edit 'tests/testthat/test-my-test.R'
#> βœ” Adding testthat to 'Suggests' field in DESCRIPTION.
#> βœ” Adding "3" to 'Config/testthat/edition'.
#> βœ” Creating 'tests/testthat/'.
#> βœ” Writing 'tests/testthat.R'.
#> βœ” Writing 'tests/testthat/test-my-test.R'.
#> ☐ Edit 'tests/testthat/test-my-test.R'.

x <- 1
y <- 2
use_data(x, y)
#> βœ” Adding 'R' to Depends field in DESCRIPTION
#> βœ” Creating 'data/'
#> βœ” Setting LazyData to 'true' in 'DESCRIPTION'
#> βœ” Saving 'x', 'y' to 'data/x.rda', 'data/y.rda'
#> β€’ Document your data (see 'https://r-pkgs.org/data.html')
#> βœ” Adding R to 'Depends' field in DESCRIPTION.
#> βœ” Creating 'data/'.
#> βœ” Setting 'LazyData' to "true" in 'DESCRIPTION'.
#> βœ” Saving "x" and "y" to "data/x.rda" and "data/y.rda".
#> ☐ Document your data (see <https://r-pkgs.org/data.html>).

# Use git ------------------------------------------------------------
use_git()
#> βœ” Initialising Git repo
#> βœ” Adding '.Rproj.user', '.Rhistory', '.Rdata', '.httr-oauth', '.DS_Store', '.quarto' to '.gitignore'
#> βœ” Initialising Git repo.
#> βœ” Adding ".Rproj.user", ".Rhistory", ".Rdata", ".httr-oauth", ".DS_Store", and
#> ".quarto" to '.gitignore'.
```

## Code of Conduct
Expand Down

0 comments on commit 9143717

Please sign in to comment.