-
Notifications
You must be signed in to change notification settings - Fork 0
/
_xREADME-SETUP
51 lines (44 loc) · 1.98 KB
/
_xREADME-SETUP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Simple log to document steps setting up a package repo on github and link it to posit.cloud
I. setup git and posit cloud
* create github repo (i.e. ansperf at org github)
* create new project in posit.cloud selecting "from github"
* on posit.cloud: rename project.Rproj to packagename.Rproj
* on posit.cloud: need to install utility packages
+ install.packages(c("roxygen2","devtools","usethis","testthat", "pkgdown"))
+ install.packages("tidyverse", "arrow")
* configure package
+ usethis::use_description(fields = list(Package = "ansperf"))
+ usethis::edit_file("DESCRIPTION") # edit as appropriate
* setup environment
+ Tools >> Project Options >> Build Tools
+ select Package (from drop-down)
+ select Create documentation with Roxygen, activate all options
+ OK and close Project Options
* go to Build tab (after posit.cloud restarted and shows it)
hook up posit.cloud and github with PAT
* run to check: usethis::git_siterep()
then walk through it to clean the configs
* (if needed, set) usethis::use_git_config(user.name = "as-appropriate", user.email = "whatevername@org")
* usethis::git_vaccinate() # good practice shielding specs
* setup PAT
+ usethis::create_github_token()
+ gitcreds::gitcreds_set() # paste token, gitcreds installed with {usethis}
setup packagedown
* Run once to configure your package to use pkgdown
usethis::use_pkgdown()
* (modify _pkgdown.yml)
* setup pkgdown workflow: usethis::use_pkgdown_github_pages()
* usethis::use_readme_rmd()
Edit your README.Rmd file
Build your README.md file by running devtools::build_readme() in the R console
setup testthat
usethis::use_testthat(edition = 3) # make sure e3
create functions
* usethis::use_r("function-name-file")
* CTRL+SHIFT+b (to build package)
* CTRL+SHIFT+l (to load and test function)
* CTRL+SHIFT+E to check all
To build a Source Package do the following:
Create a new folder tmp
devtools::build(path = "tmp")
The resulting file, e.g. mypkg_0.0.0.9000.tar.gz can be downloaded to your computer.