-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupPackage.qmd
60 lines (39 loc) · 900 Bytes
/
setupPackage.qmd
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
52
53
54
55
56
57
58
---
title: "Setup Package"
format: html
editor: source
---
## Load libs
```{r}
# Dependencies
require(utils)
require(here)
require(usethis)
```
## Check running
```{r}
# This script should only be run ONCE at the start of the project
runSetup <- utils::askYesNo("THIS SCRIPT SHOULD ONLY BE RUN ONCE THAT THE START OF A PROJECT: PROCEED??")
```
## Perform set-up
```{r}
if (runSetup) {
# Set up functionalities
message("//// Setting up package functionalities...")
# Set up git
message("// Git repo...")
usethis::use_git()
# Set up license
message("// Setting license (MIT)...")
usethis::use_mit_license()
# Initialise tests
message("// Initialise Tests...")
usethis::use_testthat()
# Use gitHub
message("// Linking to GitHub...")
usethis::use_github()
# Create README
message("// Creating README...")
usethis::use_readme_rmd()
}
```