Skip to content

Commit 56bf0f9

Browse files
committed
Generic skrpt to add data to the package
1 parent cd547d4 commit 56bf0f9

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

inst/extdata/scripts/add_data.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 1. write data and save as .rda file in the package/data folder
2+
# --> can be done by usethis::use_data()
3+
# (the filename should be the same as the variable name)
4+
5+
# 2. add the variable to the global variables of the package in the
6+
# package/R/zzz.R file to avoid the note about missing global bindings by the
7+
# devtool check
8+
9+
# 3. Document the dataset in the file data_properties_names.R in the package/R
10+
# folder
11+
# NULL can be assigned to the documentation to avoid the devtools warning
12+
# message "Variables with usage in documentation ... but not in code"
13+
14+
15+
var # define variable
16+
usethis::use_data(var, overwrite = TRUE) # save variable as rda
17+

0 commit comments

Comments
 (0)