pew: pew dataset from the reshape paper dataset in JSS inequality...

Description Format Examples

Description

Dataset collected by Pew with counts of people cross-tabulated by religion and income band. See https://www.jstatsoft.org/article/view/v059i10 for more information.

Format

A data frame with 18 rows by 10 columns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# Download data from its original source - an academic paper
downloader::download("http://www.jstatsoft.org/v59/i10/supp/4",
 destfile = "v59i10-data.zip")
# The source code associated with the paper
#'downloader::download("http://www.jstatsoft.org/v59/i10/supp/3",
 destfile = "extdata/reshape/v59i10.R")
# After running the R script...
dir.create("extdata/reshape")
unzip("v59i10-data.zip", exdir = "extdata/reshape/")
# write.csv(raw, "extdata/reshape-pew.csv")
# generate pew dataset
pew = read_csv("extdata/reshape-pew.csv")
pew = pew[-c(1, ncol(pew))] # remove excess cols
names(pew) = c("religion", "<$10k", "$10--20k", "$20--30k", "$30--40k",
               "$40--50k", "$50--75k", "$75--100k", "$100--150k", ">150k")
# write_csv(pew, "extdata/pew.csv")

## End(Not run)

akrmenec/efficient-R documentation built on May 28, 2019, 4:53 p.m.