/
Update rDNA package.R
115 lines (101 loc) · 2.32 KB
/
Update rDNA package.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# how to write an R package https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/
library("devtools")
library("roxygen2")
#Update Documentation
#setwd("C:/Users/binis/Documents/GitHub/dna/rDNA")
#setwd("F:/Dropbox/Github/dna/rDNA")
# setwd("/home/johannes/Documents/Github 4/dna/rDNA/")
setwd("/home/johannes/Documents/Github/dna/rDNA/")
desc <- readLines("DESCRIPTION")
date <- desc[grepl("^Date:", desc)]
date2 <- gsub("[^[:digit:]-]", "", date)
desc[grepl("^Date:", desc)] <- gsub(date2, Sys.Date(), desc[grepl("^Date:", desc)])
vers <- desc[grepl("^Version:", desc)]
vers2 <- gsub("[^[:digit:].]", "", vers)
vers3 <- readline(prompt = paste("New Version? Old:", vers2))
desc[grepl("^Version:", desc)] <- gsub(vers2, vers3, desc[grepl("^Version:", desc)])
writeLines(desc, "DESCRIPTION")
roxygen2::roxygenise(clean = TRUE)
setwd("..")
devtools::check("rDNA")
devtools::spell_check("rDNA", dict = "en_GB", ignore = c(
"CLASSPATH",
"dd",
"dna",
"DNA's",
"docTitle",
"excludeTypes",
"Gruber",
"Leifeld",
"igraph",
"ggplot",
"java",
"Jaccard",
"etc",
"mySQL",
"nw",
"org",
"pts",
"wd",
"plottable",
"linetype",
"bw",
"color",
"cutree",
"eigen",
"lineend",
"louvain",
"mcquitty",
"MDS",
"pam",
"plotDendro",
"RColorBrewer",
"walktrap",
"yyyy",
"onemode",
"twomode",
"getDocuments",
"clust",
"dh",
"drl",
"graphopt",
"kk",
"knitr",
"lables",
"lgl",
"mds",
"POSIXct",
"qualifierAggregation",
"setDocuments",
"dist",
"edgelist",
"eventSequence",
"isoMDS",
"plotMDS",
"timewindow",
"vegdist"
))
#source("https://install-github.me/MangoTheCat/goodpractice")
#goodpractice::gp("rDNA")
#lintr::lint("rDNA.R")
#lintr::lint_package("rDNA")
#devtools::install("rDNA")
# update github
system("git status")
system("git add -A")
commit_message <- readline(prompt = "Commit message")
system(paste0("git commit -m'",
commit_message,
"'"))
#build
build(pkg = "rDNA", manual = TRUE)
# create the package in wd
setwd("C:/Users/binis/Documents/GitHub/dna")
install("rDNA", args = c("--no-multiarch", "--no-test-load"))
# change version number in manual
### quick test
setwd("/home/johannes/Documents/Github/dna/rDNA/")
roxygen2::roxygenise(clean = TRUE)
setwd("..")
#devtools::check("rDNA")
devtools::install("rDNA")