-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys_process_documentation.txt
65 lines (37 loc) · 2.51 KB
/
keys_process_documentation.txt
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
Creating and Updating {mapcdatakeys} package
2022-07-13
Aseem Deodhar
Update -
2024-08-28
Brandon Stanaway
Introduction
The {mapcdatakeys} package contains various municipal and census geography level keys, creating an official standardized format which is easily accessible without depending on static files. This document details out the process required for generating the annual update that municipal level GEOIDs *may* have with the release of the ACS every year.
While general package development requires a lot of steps and checks, this document will only highlight the steps required for this annual update. Please refer to chapter 12 of the rstudio4edu book developed by Alison Hill and Desiree De Leon for a detailed description on developing and maintaining data packages for R: https://rstudio4edu.github.io/rstudio4edu-book/data-pkg.html
Step 0: Required packages:
Make sure the following packages are installed in your R environment before proceeding:
#install.packages(c("usethis", "devtools", "roxygen2"))
library(usethis)
library(roxygen2)
library(devtools)
Step 1: Generate New Data
The RScript file called muni_data_keys.R in the data-raw folder creates the various data-tables we have in our package. It has instructions on how to edit and run it to add the latest annual municipal geoid values.
Please add the most recent year to the list of years on line 16 to update the "cosub_id" column in the
If any additional tables are added, please add them to the list of tables to be published on line 179.
Run this entire file and follow instructions if you want to add or make any changes.
Step 2: Check for Errors and Warnings:
Run the following code in the Console:
devtools::check(document=FALSE)
This will take a bit of time. If there are no errors or warnings, proceed. You may get some notes, but you can ignore that. If there are any errors or warnings, check the message and rectify. Repeat until you get no error or warning messages.
Step 3: Documentation
Unless you're creating a new package, this step is not necessary.
Step 4: Installation
This step installs the package in your system.
Run the following code in the Console:
devtools::install()
You can test it out by calling mapcdatakeys::all_muni_data_keys and check that the latest added column is present.
Step 5: Github
Push to the MAPC/mapcdatakeys Github repo!
Step 6: Remote Installation
To install this package on any system, run the following code in that system:
# install.packages("remotes")
remotes::install_github("rstudio4edu/testpackage")