-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathinstall.R
More file actions
34 lines (29 loc) · 949 Bytes
/
install.R
File metadata and controls
34 lines (29 loc) · 949 Bytes
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
update.packages()
packages = c("devtools", "choroplethr", "choroplethrMaps")
if (length(setdiff(packages, rownames(installed.packages()))) > 0)
{
install.packages(setdiff(packages, rownames(installed.packages())))
}
# choroplethr_zip is on github, not cran
if (!("choroplethrZip" %in% rownames(installed.packages())) ||
packageVersion("choroplethrZip" != "1.3.0"))
{
library(devtools)
install_github('arilamstein/choroplethrZip@v1.3.0')
}
# lastly, make sure people are using a current version of R
r = R.Version()
if (r$major < "3" ||
(r$major == "3" && r$minor < "2.0"))
{
print(paste0(
"The current version of R is 3.2.0, but you are using version ",
r$major, ".", r$minor,
". Please google 'download R' and download the current version of R."
))
}
# now test
library(choroplethr)
data(df_pop_state)
print(state_choropleth(df_pop_state))
# state_choropleth_acs("B01003", endyear=2012, span=5)