Skip to content

Commit b6589d9

Browse files
committed
skip local builds, badges on one line
1 parent 59a62a4 commit b6589d9

File tree

98 files changed

+2644
-2885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2644
-2885
lines changed

README.md

Lines changed: 46 additions & 46 deletions
Large diffs are not rendered by default.

acs.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# American Community Survey (ACS) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/acs/actions"><img src="https://github.com/asdfree/acs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/acs/actions"><img src="https://github.com/asdfree/acs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
The US Census Bureau's annual replacement for the long-form decennial census.
86

@@ -90,7 +88,7 @@ stopifnot( nrow( acs_df ) == nrow( acs_df_person ) )
9088
acs_df[ , 'one' ] <- 1
9189
```
9290

93-
### Save locally \ {-}
91+
### Save Locally \ {-}
9492

9593
Save the object at any point:
9694

ahrf.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Area Health Resources Files (AHRF) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/ahrf/actions"><img src="https://github.com/asdfree/ahrf/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/ahrf/actions"><img src="https://github.com/asdfree/ahrf/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
National, state, and county-level data on health care professions, health facilities, population characteristics, health workforce training, hospital utilization and expenditure, and the environment.
86

@@ -54,7 +52,7 @@ names( ahrf_df ) <- tolower( names( ahrf_df ) )
5452
5553
```
5654

57-
### Save locally \ {-}
55+
### Save Locally \ {-}
5856

5957
Save the object at any point:
6058

ahs.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# American Housing Survey (AHS) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/ahs/actions"><img src="https://github.com/asdfree/ahs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/ahs/actions"><img src="https://github.com/asdfree/ahs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
The nationwide assessment of housing stock, with information on physical condition and neighborhood, costs of financing and maintenance, owner and renter characteristics, and changes over time.
86

@@ -56,7 +54,7 @@ ahs_df <- data.frame( ahs_tbl )
5654
names( ahs_df ) <- tolower( names( ahs_df ) )
5755
```
5856

59-
### Save locally \ {-}
57+
### Save Locally \ {-}
6058

6159
Save the object at any point:
6260

anes.Rmd

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
```{r eval = TRUE , echo = FALSE , results = "hide" , warning = FALSE , message = FALSE }
2-
objects_in_memory_for_local_build <- ls()
3-
```
4-
51
# American National Election Studies (ANES) {-}
62

7-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
8-
9-
```{r , echo = FALSE }
10-
11-
most_recent_build_date <- gsub( "-" , " " , if( dir.exists( "_bookdown_files/" ) ) as.Date( file.info( "_bookdown_files/" )$ctime ) else Sys.Date() )
12-
13-
anes_badge <- paste0( "<img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-" , most_recent_build_date , "-brightgreen' alt='Local Testing Badge'>" )
14-
15-
```
16-
17-
`r anes_badge`
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <img src='https://img.shields.io/badge/Tested%20Locally-Windows%20Laptop-brightgreen' alt='Local Testing Badge'>
184

195
A time series recording belief, public opinion, and political participation back to Dewey vs. Truman.
206

@@ -48,7 +34,7 @@ Please skim before you begin:
4834

4935
Define a function to import a stata file as a data.frame:
5036

51-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
37+
```{r eval = FALSE , results = "hide" }
5238
library(haven)
5339
5440
anes_import_dta <-
@@ -72,7 +58,7 @@ anes_import_dta <-
7258

7359
3. Download the `STATA` version of the February 10, 2022 file:
7460

75-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
61+
```{r eval = FALSE , results = "hide" }
7662
library(haven)
7763
7864
anes_fn <-
@@ -84,25 +70,25 @@ anes_fn <-
8470
anes_df <- anes_import_dta( anes_fn )
8571
```
8672

87-
### Save locally \ {-}
73+
### Save Locally \ {-}
8874

8975
Save the object at any point:
9076

91-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
77+
```{r eval = FALSE , results = "hide" }
9278
# anes_fn <- file.path( path.expand( "~" ) , "ANES" , "this_file.rds" )
9379
# saveRDS( anes_df , file = anes_fn , compress = FALSE )
9480
```
9581

9682
Load the same object:
9783

98-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
84+
```{r eval = FALSE , results = "hide" }
9985
# anes_df <- readRDS( anes_fn )
10086
```
10187

10288
### Survey Design Definition {-}
10389
Construct a complex sample survey design:
10490

105-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
91+
```{r eval = FALSE , results = "hide" }
10692
library(survey)
10793
10894
anes_design <-
@@ -118,7 +104,7 @@ anes_design <-
118104
### Variable Recoding {-}
119105

120106
Add new columns to the data set:
121-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
107+
```{r eval = FALSE , results = "hide" }
122108
anes_design <-
123109
update(
124110
anes_design ,
@@ -156,15 +142,15 @@ anes_design <-
156142
### Unweighted Counts {-}
157143

158144
Count the unweighted number of records in the survey sample, overall and by groups:
159-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
145+
```{r eval = FALSE , results = "hide" }
160146
sum( weights( anes_design , "sampling" ) != 0 )
161147
162148
svyby( ~ one , ~ undoc_kids , anes_design , unwtd.count )
163149
```
164150

165151
### Weighted Counts {-}
166152
Count the weighted size of the generalizable population, overall and by groups:
167-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
153+
```{r eval = FALSE , results = "hide" }
168154
svytotal( ~ one , anes_design )
169155
170156
svyby( ~ one , ~ undoc_kids , anes_design , svytotal )
@@ -173,35 +159,35 @@ svyby( ~ one , ~ undoc_kids , anes_design , svytotal )
173159
### Descriptive Statistics {-}
174160

175161
Calculate the mean (average) of a linear variable, overall and by groups:
176-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
162+
```{r eval = FALSE , results = "hide" }
177163
svymean( ~ republican_party_rating , anes_design , na.rm = TRUE )
178164
179165
svyby( ~ republican_party_rating , ~ undoc_kids , anes_design , svymean , na.rm = TRUE )
180166
```
181167

182168
Calculate the distribution of a categorical variable, overall and by groups:
183-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
169+
```{r eval = FALSE , results = "hide" }
184170
svymean( ~ think_gov_spend_least , anes_design , na.rm = TRUE )
185171
186172
svyby( ~ think_gov_spend_least , ~ undoc_kids , anes_design , svymean , na.rm = TRUE )
187173
```
188174

189175
Calculate the sum of a linear variable, overall and by groups:
190-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
176+
```{r eval = FALSE , results = "hide" }
191177
svytotal( ~ republican_party_rating , anes_design , na.rm = TRUE )
192178
193179
svyby( ~ republican_party_rating , ~ undoc_kids , anes_design , svytotal , na.rm = TRUE )
194180
```
195181

196182
Calculate the weighted sum of a categorical variable, overall and by groups:
197-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
183+
```{r eval = FALSE , results = "hide" }
198184
svytotal( ~ think_gov_spend_least , anes_design , na.rm = TRUE )
199185
200186
svyby( ~ think_gov_spend_least , ~ undoc_kids , anes_design , svytotal , na.rm = TRUE )
201187
```
202188

203189
Calculate the median (50th percentile) of a linear variable, overall and by groups:
204-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
190+
```{r eval = FALSE , results = "hide" }
205191
svyquantile( ~ republican_party_rating , anes_design , 0.5 , na.rm = TRUE )
206192
207193
svyby(
@@ -215,7 +201,7 @@ svyby(
215201
```
216202

217203
Estimate a ratio:
218-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
204+
```{r eval = FALSE , results = "hide" }
219205
svyratio(
220206
numerator = ~ republican_party_rating ,
221207
denominator = ~ democratic_party_rating ,
@@ -227,18 +213,18 @@ svyratio(
227213
### Subsetting {-}
228214

229215
Restrict the survey design to party id: independent:
230-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
216+
```{r eval = FALSE , results = "hide" }
231217
sub_anes_design <- subset( anes_design , v201231x == 4 )
232218
```
233219
Calculate the mean (average) of this subset:
234-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
220+
```{r eval = FALSE , results = "hide" }
235221
svymean( ~ republican_party_rating , sub_anes_design , na.rm = TRUE )
236222
```
237223

238224
### Measures of Uncertainty {-}
239225

240226
Extract the coefficient, standard error, confidence interval, and coefficient of variation from any descriptive statistics function result, overall and by groups:
241-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
227+
```{r eval = FALSE , results = "hide" }
242228
this_result <- svymean( ~ republican_party_rating , anes_design , na.rm = TRUE )
243229
244230
coef( this_result )
@@ -262,17 +248,17 @@ cv( grouped_result )
262248
```
263249

264250
Calculate the degrees of freedom of any survey design object:
265-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
251+
```{r eval = FALSE , results = "hide" }
266252
degf( anes_design )
267253
```
268254

269255
Calculate the complex sample survey-adjusted variance of any statistic:
270-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
256+
```{r eval = FALSE , results = "hide" }
271257
svyvar( ~ republican_party_rating , anes_design , na.rm = TRUE )
272258
```
273259

274260
Include the complex sample design effect in the result for a specific statistic:
275-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
261+
```{r eval = FALSE , results = "hide" }
276262
# SRS without replacement
277263
svymean( ~ republican_party_rating , anes_design , na.rm = TRUE , deff = TRUE )
278264
@@ -281,28 +267,28 @@ svymean( ~ republican_party_rating , anes_design , na.rm = TRUE , deff = "replac
281267
```
282268

283269
Compute confidence intervals for proportions using methods that may be more accurate near 0 and 1. See `?svyciprop` for alternatives:
284-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
270+
```{r eval = FALSE , results = "hide" }
285271
svyciprop( ~ primary_voter , anes_design ,
286272
method = "likelihood" , na.rm = TRUE )
287273
```
288274

289275
### Regression Models and Tests of Association {-}
290276

291277
Perform a design-based t-test:
292-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
278+
```{r eval = FALSE , results = "hide" }
293279
svyttest( republican_party_rating ~ primary_voter , anes_design )
294280
```
295281

296282
Perform a chi-squared test of association for survey data:
297-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
283+
```{r eval = FALSE , results = "hide" }
298284
svychisq(
299285
~ primary_voter + think_gov_spend_least ,
300286
anes_design
301287
)
302288
```
303289

304290
Perform a survey-weighted generalized linear model:
305-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
291+
```{r eval = FALSE , results = "hide" }
306292
glm_result <-
307293
svyglm(
308294
republican_party_rating ~ primary_voter + think_gov_spend_least ,
@@ -326,7 +312,7 @@ This example matches statistics and standard errors in the Age rows of the `ANES
326312

327313
4. Download the `DTA` version of the `Methodology File December 10, 2018`
328314

329-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
315+
```{r eval = FALSE , results = "hide" }
330316
anes2016_fn <-
331317
file.path(
332318
path.expand( "~" ) ,
@@ -389,7 +375,7 @@ This example matches statistics and standard errors in the Age rows of the `Desi
389375

390376
5. Download the `DTA` version of the April 26, 2007 file
391377

392-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
378+
```{r eval = FALSE , results = "hide" }
393379
anes2004_fn <-
394380
file.path(
395381
path.expand( "~" ) ,
@@ -447,12 +433,12 @@ stopifnot( all( round( SE( results ) , 4 ) == published_standard_errors ) )
447433

448434
The R `srvyr` library calculates summary statistics from survey data, such as the mean, total or quantile using [dplyr](https://github.com/tidyverse/dplyr/)-like syntax. [srvyr](https://github.com/gergness/srvyr) allows for the use of many verbs, such as `summarize`, `group_by`, and `mutate`, the convenience of pipe-able functions, the `tidyverse` style of non-standard evaluation and more consistent return types than the `survey` package. [This vignette](https://cran.r-project.org/web/packages/srvyr/vignettes/srvyr-vs-survey.html) details the available features. As a starting point for ANES users, this code replicates previously-presented examples:
449435

450-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
436+
```{r eval = FALSE , results = "hide" }
451437
library(srvyr)
452438
anes_srvyr_design <- as_survey( anes_design )
453439
```
454440
Calculate the mean (average) of a linear variable, overall and by groups:
455-
```{r cache = TRUE , warning = FALSE , message = FALSE , results = "hide" }
441+
```{r eval = FALSE , results = "hide" }
456442
anes_srvyr_design %>%
457443
summarize( mean = survey_mean( republican_party_rating , na.rm = TRUE ) )
458444
@@ -462,7 +448,3 @@ anes_srvyr_design %>%
462448
```
463449

464450

465-
```{r eval = TRUE , echo = FALSE , results = "hide" , warning = FALSE , message = FALSE }
466-
rm( list = setdiff( ls() , objects_in_memory_for_local_build ) ) ; gc()
467-
```
468-

atus.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# American Time Use Survey (ATUS) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/atus/actions"><img src="https://github.com/asdfree/atus/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/atus/actions"><img src="https://github.com/asdfree/atus/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
Sampled individuals write down everything they do for a single twenty-four hour period, in ten minute intervals. Time use data allows for the study of uncompensated work like cooking, chores, childcare.
86

@@ -129,7 +127,7 @@ names( atus_df ) <- gsub( "\\." , "_" , names( atus_df ) )
129127
atus_df[ , 'one' ] <- 1
130128
```
131129

132-
### Save locally \ {-}
130+
### Save Locally \ {-}
133131

134132
Save the object at any point:
135133

brfss.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Behavioral Risk Factor Surveillance System (BRFSS) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/brfss/actions"><img src="https://github.com/asdfree/brfss/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/brfss/actions"><img src="https://github.com/asdfree/brfss/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
A health behavior telephone interview survey with enough sample size to examine all fifty states.
86

@@ -53,7 +51,7 @@ names( brfss_df ) <- tolower( names( brfss_df ) )
5351
brfss_df[ , 'one' ] <- 1
5452
```
5553

56-
### Save locally \ {-}
54+
### Save Locally \ {-}
5755

5856
Save the object at any point:
5957

ces.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Consumer Expenditure Survey (CES) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/ces/actions"><img src="https://github.com/asdfree/ces/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/ces/actions"><img src="https://github.com/asdfree/ces/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
A household budget survey designed to guide major economic indicators like the Consumer Price Index.
86

@@ -177,7 +175,7 @@ stopifnot( nrow( ces_df ) == before_nrow )
177175
ces_df[ is.na( ces_df[ , 'new_car_truck_exp' ] ) , 'new_car_truck_exp' ] <- 0
178176
```
179177

180-
### Save locally \ {-}
178+
### Save Locally \ {-}
181179

182180
Save the object at any point:
183181

cog.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Census of Governments (COG) {-}
22

3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4-
5-
<a href="https://github.com/asdfree/cog/actions"><img src="https://github.com/asdfree/cog/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) <a href="https://github.com/asdfree/cog/actions"><img src="https://github.com/asdfree/cog/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a>
64

75
Location, employment, and payroll for state and local (but not federal) government agencies in the U.S.
86

@@ -160,7 +158,7 @@ cog_df <- subset( double_df , !grepl( "Total" , government_function ) )
160158
# cog_df <- subset( double_df , grepl( "Total" , government_function ) )
161159
```
162160

163-
### Save locally \ {-}
161+
### Save Locally \ {-}
164162

165163
Save the object at any point:
166164

0 commit comments

Comments
 (0)