-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.r
57 lines (45 loc) · 1.19 KB
/
build.r
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
# # based on guide written by https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/
# # 1 dependencies
# install.packages("devtools")
# library("devtools")
# devtools::install_github("klutometis/NLP")
library(roxygen2)
# # 2 working directory
setwd("~/git/")
# # 3 create minimum folders
# devtools::create("NLP")
# # 4 write functions and documentation using roxygen formatting
# # Use below template and put these functions into the R folder.
#' A Cat Function
#'
#' This function allows you to express your love of cats.
#' @param love Do you love cats? Defaults to TRUE.
#' @keywords cats
#' @export
#' @examples
#' cat_function()
cat_function <- function(love=TRUE){
if(love==TRUE){
print("I love cats!")
}
else {
print("I am not a cool person.")
}
}
# # 5 use roxygen to write the docs for the package
library(devtools)
setwd("~/git/SCED")
roxygen2::roxygenise()
# # 6 install the package
library(devtools)
setwd("~/git/")
install("SCED")
# # 7 place in a GitHub repo
# # 8 installation for users
# # install packages (first time only)
#install.packages("devtools")
#library(devtools)
#install_github("ianhussey/NLP")
# # load packages
library(devtools)
library(SCED)