You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the `tigris` package get Census Tiger shapefiles for census geographies. Tigris will return the shapefile in the `sf`, or simple features, format.
16
16
17
17
```{r get-data, message=FALSE, warning=FALSE}
18
-
us_geo <- tigris::states(class = "sf") %>%
19
-
shift_geometry()
18
+
us_geo <- tigris::states(class = "sf", cb = TRUE) %>% #cb is a more generalized, less detailed file.
19
+
shift_geometry() %>%
20
+
filter(as.numeric(GEOID) < 60)
20
21
```
21
22
22
23
## Get BLS data
23
24
24
-
I've already downloaded and stored some data from the Bureau of Labor Statistics. Thoses data are stored in an excel file in the `data` directory of the repository: `data/OES_Report.xlsx`. **The goal is to attach this data to the previously downloaded shapefiles.**
25
+
I've already downloaded and stored some data from the Bureau of Labor Statistics. Those data are stored in an excel file in the `data` directory of the github repository: `data/OES_Report.xlsx`. **The goal is to attach this data to the previously downloaded shapefiles.**
25
26
26
-
But you may be intersted in how I gathered the data. below are some summary notes documenting my steps of gathering the data from the Bureau of Labor Statistics.
27
+
But you may be interested in how I gathered the data. below are some summary notes documenting my steps of gathering the data from the Bureau of Labor Statistics.
<spanclass='kw'><ahref='https://rdrr.io/r/base/library.html'>library</a></span><spanclass='op'>(</span><spanclass='va'><ahref='https://github.com/walkerke/tigris'>tigris</a></span><spanclass='op'>)</span><spanclass='co'># Get Census Geography Poloygons</span>
@@ -2127,14 +2127,15 @@ <h2 id="shapefiles-as-sf">Shapefiles as sf</h2>
2127
2127
<p>Using the <code>tigris</code> package get Census Tiger shapefiles for census geographies. Tigris will return the shapefile in the <code>sf</code>, or simple features, format.</p>
<preclass="sourceCode r"><codeclass="sourceCode r"><spanclass='va'>us_geo</span><spanclass='op'><-</span><spanclass='fu'>tigris</span><spanclass='fu'>::</span><spanclass='fu'><ahref='https://rdrr.io/pkg/tigris/man/states.html'>states</a></span><spanclass='op'>(</span>class <spanclass='op'>=</span><spanclass='st'>"sf"</span>, cb <spanclass='op'>=</span><spanclass='cn'>TRUE</span><spanclass='op'>)</span><spanclass='op'>%>%</span><spanclass='co'>#cb is a more generalized, less detailed file.</span>
<p>I’ve already downloaded and stored some data from the Bureau of Labor Statistics. Thoses data are stored in an excel file in the <code>data</code> directory of the repository: <code>data/OES_Report.xlsx</code>. <strong>The goal is to attach this data to the previously downloaded shapefiles.</strong></p>
2137
-
<p>But you may be intersted in how I gathered the data. below are some summary notes documenting my steps of gathering the data from the Bureau of Labor Statistics.</p>
2137
+
<p>I’ve already downloaded and stored some data from the Bureau of Labor Statistics. Those data are stored in an excel file in the <code>data</code> directory of the github repository: <code>data/OES_Report.xlsx</code>. <strong>The goal is to attach this data to the previously downloaded shapefiles.</strong></p>
2138
+
<p>But you may be interested in how I gathered the data. below are some summary notes documenting my steps of gathering the data from the Bureau of Labor Statistics.</p>
<spanclass='fu'>ggplot</span><spanclass='op'>(</span><spanclass='fu'>aes</span><spanclass='op'>(</span>fill <spanclass='op'>=</span><spanclass='va'>wages</span>, color <spanclass='op'>=</span><spanclass='va'>wages</span><spanclass='op'>)</span><spanclass='op'>)</span><spanclass='op'>+</span>
<spanclass='fu'>coord_sf</span><spanclass='op'>(</span>crs <spanclass='op'>=</span><spanclass='fl'>5070</span>, datum <spanclass='op'>=</span><spanclass='cn'>NA</span><spanclass='op'>)</span><spanclass='op'>+</span>
0 commit comments