devstuffs.R 4.44 KB
Newer Older
kapsner's avatar
kapsner committed
1
2
3
4
5
6
7
8
9
10
packagename <- "DQAgui"

# remove existing description object
unlink("DESCRIPTION")
# Create a new description object
my_desc <- desc::description$new("!new")
# Set your package name
my_desc$set("Package", packagename)
# Set author names
my_desc$set_authors(c(
11
12
13
14
15
16
17
18
19
20
21
22
  person(
    "Lorenz A.",
    "Kapsner",
    email = "lorenz.kapsner@uk-erlangen.de",
    role = c('cre', 'aut'),
    comment = c(ORCID = "0000-0003-1866-860X")
  ),
  person(
    "Jonathan M.",
    "Mang",
    role = c('aut'),
    comment = c(ORCID = "0000-0003-0518-4710")
23
24
  ),
  person("MIRACUM - Medical Informatics in Research and Care in University Medicine", role = c("fnd"))
25
))
kapsner's avatar
kapsner committed
26
27
#  person("Name2", "Surname2", email = "mail@2", role = 'aut')))
# Set copyright
Lorenz Kapsner's avatar
Lorenz Kapsner committed
28
my_desc$set("Copyright", "Universitätsklinikum Erlangen")
kapsner's avatar
kapsner committed
29
30
31
# Remove some author fields
my_desc$del("Maintainer")
# Set the version
Lorenz Kapsner's avatar
Lorenz Kapsner committed
32
my_desc$set_version("0.1.1")
kapsner's avatar
kapsner committed
33
34
35
36
37
# The title of your package
my_desc$set(Title = "DQA GUI")
# The description of your package
my_desc$set(Description = "A graphical user interface (GUI) to the functions implemented in the R package 'DQAstats'.")
# The description of your package
38
my_desc$set("Date" = as.character(Sys.Date()))
kapsner's avatar
kapsner committed
39
# The urls
Lorenz Kapsner's avatar
Lorenz Kapsner committed
40
my_desc$set("URL", "https://gitlab.miracum.org/miracum/dqa/dqagui")
kapsner's avatar
kapsner committed
41
my_desc$set("BugReports",
Lorenz Kapsner's avatar
Lorenz Kapsner committed
42
            "https://gitlab.miracum.org/miracum/dqa/dqagui/issues")
kapsner's avatar
kapsner committed
43
44
45
46
47
48
# License
my_desc$set("License", "GPL-3")
# Save everyting
my_desc$write(file = "DESCRIPTION")

# License
Jonathan Mang's avatar
Jonathan Mang committed
49
#usethis::use_gpl3_license(name="Universitätsklinikum Erlangen")
kapsner's avatar
kapsner committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66


# add Imports and Depends
# Listing a package in either Depends or Imports ensures that it’s installed when needed
# Imports just loads the package, Depends attaches it
# Loading will load code, data and any DLLs; register S3 and S4 methods; and run the .onLoad() function.
##      After loading, the package is available in memory, but because it’s not in the search path,
##      you won’t be able to access its components without using ::.
##      Confusingly, :: will also load a package automatically if it isn’t already loaded.
##      It’s rare to load a package explicitly, but you can do so with requireNamespace() or loadNamespace().
# Attaching puts the package in the search path. You can’t attach a package without first loading it,
##      so both library() or require() load then attach the package.
##      You can see the currently attached packages with search().

# Depends

# Imports
67
68
69
70
71
72
73
74
75
76
77
usethis::use_package("data.table", type = "Imports")
usethis::use_package("magrittr", type = "Imports")
usethis::use_package("DT", type = "Imports")
usethis::use_package("graphics", type = "Imports")
usethis::use_package("shiny", type = "Imports")
usethis::use_package("shinydashboard", type = "Imports")
usethis::use_package("shinyFiles", type = "Imports")
usethis::use_package("shinyjs", type = "Imports")
usethis::use_package("knitr", type = "Imports")
usethis::use_package("jsonlite", type = "Imports")
usethis::use_package("config", type = "Imports")
kapsner's avatar
kapsner committed
78
79
80
81

# Suggests
usethis::use_package("testthat", type = "Suggests")
usethis::use_package("processx", type = "Suggests")
82
usethis::use_package("lintr", type = "Suggests")
kapsner's avatar
kapsner committed
83
84

# Development package
Lorenz Kapsner's avatar
Lorenz Kapsner committed
85
mytag <- "development"
86
devtools::install_git(url = "https://gitlab.miracum.org/miracum/dqa/dqastats.git", ref = mytag, upgrade = "always")
Jonathan Mang's avatar
Jonathan Mang committed
87
# usethis::use_dev_package("DQAstats", type = "Imports")
88
# https://cran.r-project.org/web/packages/devtools/vignettes/dependencies.html
89
90
desc::desc_set_remotes(c(
  paste0(
Lorenz Kapsner's avatar
Lorenz Kapsner committed
91
    "url::https://gitlab.miracum.org/miracum/dqa/dqastats/-/archive/", mytag, "/dqastats-", mytag, ".zip")
92
93
),
file = usethis::proj_get())
kapsner's avatar
kapsner committed
94

Jonathan Mang's avatar
Jonathan Mang committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
## .Rbuildignore: ##
usethis::use_build_ignore("data-raw")
usethis::use_build_ignore("LICENSE.md")
usethis::use_build_ignore(".gitlab-ci.yml")

## .gitignore:
usethis::use_git_ignore("/*")
usethis::use_git_ignore("/*/")
usethis::use_git_ignore("*.log")
usethis::use_git_ignore("!/.gitignore")
usethis::use_git_ignore("!/data-raw/")
usethis::use_git_ignore("!/DESCRIPTION")
usethis::use_git_ignore("!/inst/")
usethis::use_git_ignore("!/LICENSE.md")
usethis::use_git_ignore("!/man/")
usethis::use_git_ignore("!NAMESPACE")
usethis::use_git_ignore("!/R/")
usethis::use_git_ignore("!/README.md")
usethis::use_git_ignore("!/tests/")
usethis::use_git_ignore("/.Rhistory")
usethis::use_git_ignore("!/*.Rproj")
usethis::use_git_ignore("/.Rproj*")
usethis::use_git_ignore("/.RData")
#usethis::use_git_ignore("/inst/demo_data/utilities/MDR/.~lock.mdr_example_data.csv#")
usethis::use_git_ignore(".~lock.*.csv#")
kapsner's avatar
kapsner committed
120