Skip to content
This repository
Browse code

RCurl removal downloader addition setwd and other cleanup

  • Loading branch information...
commit d77350dea7944ae42f938372332159774aeb7fd0 1 parent c6544bc
Anthony Damico authored February 12, 2013

Showing 49 changed files with 228 additions and 283 deletions. Show diff stats Hide diff stats

  1. 25  American Community Survey/2005-2011 - download all microdata.R
  2. 4  Area Resource File/2011-2012 arf - analysis examples.R
  3. 31  Area Resource File/2011-2012 arf - download.R
  4. 2  Basic Stand Alone Medicare Claims Public Use Files/2008 - download all csv files.R
  5. 24  Basic Stand Alone Medicare Claims Public Use Files/2008 - import all csv files into monetdb.R
  6. 25  Behavioral Risk Factor Surveillance System/1984 - 2011 download all microdata.R
  7. BIN  ...ral Risk Factor Surveillance System/WEAT 2010 Alcohol Consumption by Gender - Crosstab Analysis Results.pdf
  8. 7  Consumer Expenditure Survey/2010-2011 - download all microdata.R
  9. 26  Consumer Expenditure Survey/2011 fmly intrvw - analysis examples.R
  10. 4  Consumer Expenditure Survey/replicate integrated mean and se.R
  11. 27  Current Population Survey/2005-2012 asec - download all microdata.R
  12. 5  Current Population Survey/2012 asec - analysis examples.R
  13. 5  Current Population Survey/replicate census estimates - 2011.R
  14. 5  General Social Survey/1972-2010 cumulative cross-sectional - analysis examples.R
  15. 5  General Social Survey/replicate berkeley sda.R
  16. 5  Health Professional Shortage Areas/download current hpsa table.R
  17. 5  Health Professional Shortage Areas/identify point-in-time geographic hpsas.R
  18. 5  Health Professional Shortage Areas/replicate hrsa nationwide statistics.R
  19. 5  Health and Retirement Study/1992 - 2010 download HRS microdata.R
  20. 11  Health and Retirement Study/import example HRS file.R
  21. 5  Health and Retirement Study/import longitudinal RAND contributed files.R
  22. 5  Health and Retirement Study/longitudinal RAND - analysis examples.R
  23. 5  Health and Retirement Study/replicate 2002 regression.R
  24. 7  Medical Expenditure Panel Survey/1996-2010 household component - download all microdata.R
  25. 5  Medical Expenditure Panel Survey/2010 consolidated - analyze with brr.R
  26. 5  Medical Expenditure Panel Survey/2010 consolidated - analyze with tsl.R
  27. 18  MonetDB/monetdb database creation instructions.R
  28. 2  MonetDB/monetdb installation instructions.R
  29. 4  National Health Interview Survey/2011 personsx - analyze.R
  30. 5  National Health Interview Survey/2011 personsx plus samadult with multiple imputation - analyze.R
  31. 4  National Health Interview Survey/replicate cdc tecdoc - 2000 multiple imputation.R
  32. 5  National Health and Nutrition Examination Survey/2009-2010 interview only - download and analyze.R
  33. 5  National Health and Nutrition Examination Survey/2009-2010 interview plus laboratory - download and analyze.R
  34. 5  National Health and Nutrition Examination Survey/replicate 2005-2008 pooled cdc oral examination figure.R
  35. 5  National Health and Nutrition Examination Survey/replicate cdc publications.R
  36. 7  National Survey on Drug Use and Health/1979-2011 - download all microdata.R
  37. 5  National Survey on Drug Use and Health/2010 single-year - analysis examples.R
  38. 5  National Survey on Drug Use and Health/replicate samhsa puf.R
  39. 5  Survey of Consumer Finances/1989-2010 download all microdata.R
  40. 25  Survey of Consumer Finances/2010 analysis examples.R
  41. 25  Survey of Consumer Finances/replicate FRB SAS output.R
  42. 25  Survey of Income and Program Participation/1996 panel - download and create database.R
  43. 25  Survey of Income and Program Participation/2001 panel - download and create database.R
  44. 26  Survey of Income and Program Participation/2004 panel - download and create database.R
  45. 32  Survey of Income and Program Participation/2008 panel - download and create database.R
  46. 5  Survey of Income and Program Participation/2008 panel - full year analysis examples.R
  47. 5  Survey of Income and Program Participation/2008 panel - median value of household assets.R
  48. 5  Survey of Income and Program Participation/2008 panel - point-in-time analysis examples.R
  49. 5  Survey of Income and Program Participation/replicate census poverty statistics.R
25  American Community Survey/2005-2011 - download all microdata.R
@@ -50,9 +50,9 @@
50 50
 # it's running.  don't believe me?  check the working directory (set below) for a new r data file (.rda) every few hours.
51 51
 
52 52
 
53  
-
  53
+require(downloader)		# downloads and then runs the source() function on scripts from github
54 54
 require(sqlsurvey)		# load sqlsurvey package (analyzes large complex design surveys)
55  
-require(RMonetDB)	# load the RMonetDB package (connects r to a monet database)
  55
+require(RMonetDB)		# load the RMonetDB package (connects r to a monet database)
56 56
 
57 57
 
58 58
 # set your ACS data directory
@@ -64,25 +64,10 @@ require(RMonetDB)	# load the RMonetDB package (connects r to a monet database)
64 64
 setwd( "C:/My Directory/ACS/" )
65 65
 
66 66
 
67  
-
68  
-#######################################################	
69  
-# function to download scripts directly from github.com
70  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
71  
-source_https <- function(url, ...) {
72  
-  # load package
73  
-  require(RCurl)
74  
-
75  
-  # parse and evaluate each .R script
76  
-  sapply(c(url, ...), function(u) {
77  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
78  
-  })
79  
-}
80  
-#######################################################
81  
-
82 67
 # load the windows.monetdb.configuration() function,
83 68
 # which allows the easy creation of an executable (.bat) file
84 69
 # to run the monetdb server specific to this data
85  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
  70
+source_url( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
86 71
 
87 72
 
88 73
 # create a folder "MonetDB" in your current working directory.
@@ -666,9 +651,9 @@ db <- dbConnect( drv , monet.url , user = "monetdb" , password = "monetdb" )
666 651
 
667 652
 
668 653
 # unlike most post-importation scripts, the monetdb directory cannot be set to read-only #
669  
-winDialog( 'ok' , paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
  654
+message( paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
670 655
 
671  
-winDialog( 'ok' , "got that? monetdb directories should not be set read-only." )
  656
+message( "got that? monetdb directories should not be set read-only." )
672 657
 
673 658
 
674 659
 # for more details on how to work with data in r
4  Area Resource File/2011-2012 arf - analysis examples.R
@@ -35,7 +35,9 @@
35 35
 # after running the program described above
36 36
 # use forward slashes instead of back slashes
37 37
 
38  
-setwd( "C:/My Directory/ARF/" )
  38
+# uncomment this line by removing the `#` at the front..
  39
+# setwd( "C:/My Directory/ARF/" )
  40
+# ..in order to set your current working directory
39 41
 
40 42
 
41 43
 # load the 2011-2012 ARF data file
31  Area Resource File/2011-2012 arf - download.R
@@ -28,11 +28,13 @@
28 28
 # after downloading and importing it.
29 29
 # use forward slashes instead of back slashes
30 30
 
31  
-setwd( "C:/My Directory/ARF/" )
  31
+# uncomment this line by removing the `#` at the front..
  32
+# setwd( "C:/My Directory/ARF/" )
  33
+# ..in order to set your current working directory
32 34
 
33 35
 
34 36
 # remove the # in order to run this install.packages line only once
35  
-# install.packages( c( 'SAScii' , 'descr' , 'RSQLite' ) )
  37
+# install.packages( c( 'SAScii' , 'descr' , 'RSQLite' , 'downloader' ) )
36 38
 
37 39
 
38 40
 
@@ -44,29 +46,16 @@ setwd( "C:/My Directory/ARF/" )
44 46
 # # # # # # # # #
45 47
 
46 48
 
47  
-#######################################################	
48  
-# function to download scripts directly from github.com
49  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
50  
-source_https <- function(url, ...) {
51  
-  # load package
52  
-  require(RCurl)
53  
-
54  
-  # parse and evaluate each .R script
55  
-  sapply(c(url, ...), function(u) {
56  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
57  
-  })
58  
-}
59  
-#######################################################
60  
-
61  
-# load the read.SAScii.sqlite function (a variant of read.SAScii that creates a database directly)
62  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/SQLite/read.SAScii.sqlite.R" )
63  
-
64  
-
65 49
 # load necessary libraries
66 50
 require(RSQLite) 	# load RSQLite package (creates database files in R)
67 51
 require(SAScii) 	# load the SAScii package (imports ascii data with a SAS script)
68 52
 require(descr) 		# load the descr package (converts fixed-width files to delimited files)
69 53
 require(foreign) 	# load foreign package (converts data files into R)
  54
+require(downloader)	# downloads and then runs the source() function on scripts from github
  55
+
  56
+
  57
+# load the read.SAScii.sqlite function (a variant of read.SAScii that creates a database directly)
  58
+source_url( "https://raw.github.com/ajdamico/usgsd/master/SQLite/read.SAScii.sqlite.R" )
70 59
 
71 60
 
72 61
 # create a temporary database file and another temporary file
@@ -140,7 +129,7 @@ gc()
140 129
 
141 130
 
142 131
 # print a reminder: set the directory you just saved everything to as read-only!
143  
-winDialog( 'ok' , paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
  132
+message( paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
144 133
 
145 134
 # for more details on how to work with data in r
146 135
 # check out my two minute tutorial video site
2  Basic Stand Alone Medicare Claims Public Use Files/2008 - download all csv files.R
@@ -151,7 +151,7 @@ for ( zf in all.files ){
151 151
 
152 152
 
153 153
 # print a reminder: set the directory you just saved everything to as read-only!
154  
-winDialog( 'ok' , paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
  154
+message( paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
155 155
 
156 156
 
157 157
 # for more details on how to work with data in r
24  Basic Stand Alone Medicare Claims Public Use Files/2008 - import all csv files into monetdb.R
@@ -36,10 +36,10 @@
36 36
 
37 37
 
38 38
 # remove the # in order to run this install.packages line only once
39  
-# install.packages( c( "RCurl" , "R.utils" ) )
  39
+# install.packages( c( "downloader" , "R.utils" ) )
40 40
 
41 41
 
42  
-require(RCurl)		# load RCurl package (downloads files from the web)
  42
+require(downloader)	# downloads and then runs the source() function on scripts from github
43 43
 require(R.utils)	# load the R.utils package (counts the number of lines in a file quickly)
44 44
 require(RMonetDB)	# load the RMonetDB package (connects r to a monet database)
45 45
 
@@ -67,24 +67,10 @@ setwd( "C:/My Directory/BSAPUF/" )
67 67
 year <- 2008
68 68
 
69 69
 
70  
-#######################################################	
71  
-# function to download scripts directly from github.com
72  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
73  
-source_https <- function(url, ...) {
74  
-  # load package
75  
-  require(RCurl)
76  
-
77  
-  # parse and evaluate each .R script
78  
-  sapply(c(url, ...), function(u) {
79  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
80  
-  })
81  
-}
82  
-#######################################################
83  
-
84 70
 # load the windows.monetdb.configuration() function,
85 71
 # which allows the easy creation of an executable (.bat) file
86 72
 # to run the monetdb server specific to this data
87  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
  73
+source_url( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
88 74
 
89 75
 
90 76
 # create a folder "MonetDB" in your current working directory.
@@ -385,9 +371,9 @@ db <- dbConnect( drv , monet.url , user = "monetdb" , password = "monetdb" )
385 371
 
386 372
 
387 373
 # unlike most post-importation scripts, the monetdb directory cannot be set to read-only #
388  
-winDialog( 'ok' , paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
  374
+message( paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
389 375
 
390  
-winDialog( 'ok' , "got that? monetdb directories should not be set read-only." )
  376
+message( "got that? monetdb directories should not be set read-only." )
391 377
 # don't worry, you won't update any of these tables so long as you exclusively stick with the dbGetQuery() function
392 378
 # instead of the dbSendUpdate() function (you'll see examples in the analysis scripts)
393 379
 
25  Behavioral Risk Factor Surveillance System/1984 - 2011 download all microdata.R
@@ -52,8 +52,9 @@
52 52
 
53 53
 
54 54
 require(sqlsurvey)		# load sqlsurvey package (analyzes large complex design surveys)
55  
-require(RMonetDB)	# load the RMonetDB package (connects r to a monet database)
  55
+require(RMonetDB)		# load the RMonetDB package (connects r to a monet database)
56 56
 require(foreign) 		# load foreign package (converts data files into R)
  57
+require(downloader)		# downloads and then runs the source() function on scripts from github
57 58
 
58 59
 # set your BRFSS data directory
59 60
 # after downloading and importing
@@ -65,29 +66,15 @@ setwd( "C:/My Directory/BRFSS/" )
65 66
 
66 67
 
67 68
 
68  
-#######################################################	
69  
-# function to download scripts directly from github.com
70  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
71  
-source_https <- function(url, ...) {
72  
-  # load package
73  
-  require(RCurl)
74  
-
75  
-  # parse and evaluate each .R script
76  
-  sapply(c(url, ...), function(u) {
77  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
78  
-  })
79  
-}
80  
-#######################################################
81  
-
82 69
 # load the windows.monetdb.configuration() function,
83 70
 # which allows the easy creation of an executable (.bat) file
84 71
 # to run the monetdb server specific to this data
85  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
  72
+source_url( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
86 73
 
87 74
 # load the read.SAScii.monetdb() function,
88 75
 # which imports ASCII (fixed-width) data files directly into a monet database
89 76
 # using only a SAS importation script
90  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/read.SAScii.monetdb.R" )
  77
+source_url( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/read.SAScii.monetdb.R" )
91 78
 
92 79
 
93 80
 # create a folder "MonetDB" in your current working directory.
@@ -540,9 +527,9 @@ db <- dbConnect( drv , monet.url , user = "monetdb" , password = "monetdb" )
540 527
 
541 528
 
542 529
 # unlike most post-importation scripts, the monetdb directory cannot be set to read-only #
543  
-winDialog( 'ok' , paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
  530
+message( paste( "all done.  DO NOT set" , getwd() , "read-only or subsequent scripts will not work." ) )
544 531
 
545  
-winDialog( 'ok' , "got that? monetdb directories should not be set read-only." )
  532
+message( "got that? monetdb directories should not be set read-only." )
546 533
 
547 534
 
548 535
 # for more details on how to work with data in r
BIN  ... Risk Factor Surveillance System/WEAT 2010 Alcohol Consumption by Gender - Crosstab Analysis Results.pdf
Binary file not shown
7  Consumer Expenditure Survey/2010-2011 - download all microdata.R
@@ -28,7 +28,10 @@
28 28
 # after downloading and importing it.
29 29
 # use forward slashes instead of back slashes
30 30
 
31  
-setwd( "C:/My Directory/CES/" )
  31
+# uncomment this line by removing the `#` at the front..
  32
+# setwd( "C:/My Directory/CES/" )
  33
+# ..in order to set your current working directory
  34
+
32 35
 
33 36
 
34 37
 require(foreign) 	# load foreign package (converts data files into R)
@@ -166,7 +169,7 @@ for ( year in years.to.download ){
166 169
 
167 170
 
168 171
 # print a reminder: set the directory you just saved everything to as read-only!
169  
-winDialog( 'ok' , paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
  172
+message( paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
170 173
 
171 174
 # for more details on how to work with data in r
172 175
 # check out my two minute tutorial video site
26  Consumer Expenditure Survey/2011 fmly intrvw - analysis examples.R
@@ -46,7 +46,10 @@
46 46
 # then the working directory should be set to "C:/My Directory/CES/"
47 47
 # use forward slashes instead of back slashes
48 48
 
49  
-setwd( "C:/My Directory/CES/" )
  49
+# uncomment this line by removing the `#` at the front..
  50
+# setwd( "C:/My Directory/CES/" )
  51
+# ..in order to set your current working directory
  52
+
50 53
 
51 54
 
52 55
 # turn off scientific notation in most output
@@ -55,7 +58,7 @@ options( scipen = 20 )
55 58
 
56 59
 
57 60
 # remove the # in order to run this install.packages line only once
58  
-# install.packages( c( "RSQLite" , "mitools" , "stringr" , "plyr" , "survey" , "RCurl" ) )
  61
+# install.packages( c( "RSQLite" , "mitools" , "stringr" , "plyr" , "survey" , "downloader" ) )
59 62
 
60 63
 
61 64
 require(RSQLite) 	# load RSQLite package (creates database files in R)
@@ -63,26 +66,11 @@ require(mitools)	# allows analysis of multiply-imputed survey data
63 66
 require(stringr) 	# load stringr package (manipulates character strings easily)
64 67
 require(plyr)		# contains the rbind.fill() function, which stacks two data frames even if they don't contain the same columns.  the rbind() function does not do this
65 68
 require(survey)		# load survey package (analyzes complex design surveys)
66  
-require(RCurl)		# load RCurl package (downloads files from the web)
67  
-
68  
-
69  
-#######################################################
70  
-# function to download scripts directly from github.com
71  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
72  
-source_https <- function(url, ...) {
73  
-  # load package
74  
-  require(RCurl)
75  
-
76  
-  # parse and evaluate each .R script
77  
-  sapply(c(url, ...), function(u) {
78  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
79  
-  })
80  
-}
81  
-#######################################################
  69
+require(downloader)	# downloads and then runs the source() function on scripts from github
82 70
 
83 71
 
84 72
 # load two svyttest functions (one to conduct a df-adjusted t-test and one to conduct a multiply-imputed t-test)
85  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/Consumer%20Expenditure%20Survey/ces.svyttest.R" )
  73
+source_url( "https://raw.github.com/ajdamico/usgsd/master/Consumer%20Expenditure%20Survey/ces.svyttest.R" )
86 74
 # now that these two functions have been loaded into r, you can view their source code by uncommenting the two lines below
87 75
 # svyttest.df
88 76
 # svyttest.mi
4  Consumer Expenditure Survey/replicate integrated mean and se.R
@@ -48,7 +48,9 @@
48 48
 # then the working directory should be set to "C:/My Directory/CES/"
49 49
 # use forward slashes instead of back slashes
50 50
 
51  
-setwd( "C:/My Directory/CES/" )
  51
+# uncomment this line by removing the `#` at the front..
  52
+# setwd( "C:/My Directory/CES/" )
  53
+# ..in order to set your current working directory
52 54
 
53 55
 
54 56
 # turn off scientific notation in most output
27  Current Population Survey/2005-2012 asec - download all microdata.R
@@ -28,11 +28,14 @@
28 28
 # after downloading and importing them.
29 29
 # use forward slashes instead of back slashes
30 30
 
31  
-setwd( "C:/My Directory/CPS/" )
  31
+# uncomment this line by removing the `#` at the front..
  32
+# setwd( "C:/My Directory/CPS/" )
  33
+# ..in order to set your current working directory
  34
+
32 35
 
33 36
 
34 37
 # remove the # in order to run this install.packages line only once
35  
-# install.packages( c( "survey" , "RSQLite" , "SAScii" , "descr" , "RCurl" ) )
  38
+# install.packages( c( "survey" , "RSQLite" , "SAScii" , "descr" , "downloader" ) )
36 39
 
37 40
 
38 41
 # define which years to download #
@@ -61,30 +64,16 @@ cps.dbname <- "cps.asec.db"
61 64
 # if the cps database file already exists in the current working directory, print a warning
62 65
 if ( file.exists( paste( getwd() , cps.dbname , sep = "/" ) ) ) warning( "the database file already exists in your working directory.\nyou might encounter an error if you are running the same year as before or did not allow the program to complete.\ntry changing the cps.dbname in the settings above." )
63 66
 
64  
-#######################################################	
65  
-# function to download scripts directly from github.com
66  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
67  
-source_https <- function(url, ...) {
68  
-  # load package
69  
-  require(RCurl)
70  
-
71  
-  # parse and evaluate each .R script
72  
-  sapply(c(url, ...), function(u) {
73  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
74  
-  })
75  
-}
76  
-#######################################################
77  
-
78 67
 
79 68
 require(RSQLite) 	# load RSQLite package (creates database files in R)
80 69
 require(survey)		# load survey package (analyzes complex design surveys)
81 70
 require(SAScii) 	# load the SAScii package (imports ascii data with a SAS script)
82 71
 require(descr) 		# load the descr package (converts fixed-width files to delimited files)
83  
-require(RCurl)		# load RCurl package (downloads files from the web)
  72
+require(downloader)	# downloads and then runs the source() function on scripts from github
84 73
 
85 74
 
86 75
 # load the read.SAScii.sqlite function (a variant of read.SAScii that creates a database directly)
87  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/SQLite/read.SAScii.sqlite.R" )
  76
+source_url( "https://raw.github.com/ajdamico/usgsd/master/SQLite/read.SAScii.sqlite.R" )
88 77
 
89 78
 
90 79
 # set R to produce conservative standard errors instead of crashing
@@ -419,7 +408,7 @@ for ( year in cps.years.to.download ){
419 408
 
420 409
 
421 410
 # print a reminder: set the directory you just saved everything to as read-only!
422  
-winDialog( 'ok' , paste0( "all done.  you should set the file " , file.path( getwd() , cps.dbname ) , " read-only so you don't accidentally alter these tables." ) )
  411
+message( paste0( "all done.  you should set the file " , file.path( getwd() , cps.dbname ) , " read-only so you don't accidentally alter these tables." ) )
423 412
 
424 413
 
425 414
 # for more details on how to work with data in r
5  Current Population Survey/2012 asec - analysis examples.R
@@ -45,7 +45,10 @@
45 45
 # after running the program described above
46 46
 # use forward slashes instead of back slashes
47 47
 
48  
-setwd( "C:/My Directory/CPS/" )
  48
+# uncomment this line by removing the `#` at the front..
  49
+# setwd( "C:/My Directory/CPS/" )
  50
+# ..in order to set your current working directory
  51
+
49 52
 
50 53
 
51 54
 # remove the # in order to run this install.packages line only once
5  Current Population Survey/replicate census estimates - 2011.R
@@ -46,7 +46,10 @@
46 46
 # after running the program described above
47 47
 # use forward slashes instead of back slashes
48 48
 
49  
-setwd( "C:/My Directory/CPS/" )
  49
+# uncomment this line by removing the `#` at the front..
  50
+# setwd( "C:/My Directory/CPS/" )
  51
+# ..in order to set your current working directory
  52
+
50 53
 
51 54
 
52 55
 # remove the # in order to run this install.packages line only once
5  General Social Survey/1972-2010 cumulative cross-sectional - analysis examples.R
@@ -27,7 +27,10 @@
27 27
 # after downloading and importing.
28 28
 # use forward slashes instead of back slashes
29 29
 
30  
-setwd( "C:/My Directory/GSS/" )
  30
+# uncomment this line by removing the `#` at the front..
  31
+# setwd( "C:/My Directory/GSS/" )
  32
+# ..in order to set your current working directory
  33
+
31 34
 
32 35
 
33 36
 # set the number of digits shown in all output
5  General Social Survey/replicate berkeley sda.R
@@ -44,7 +44,10 @@
44 44
 # after downloading and importing.
45 45
 # use forward slashes instead of back slashes
46 46
 
47  
-setwd( "C:/My Directory/GSS/" )
  47
+# uncomment this line by removing the `#` at the front..
  48
+# setwd( "C:/My Directory/GSS/" )
  49
+# ..in order to set your current working directory
  50
+
48 51
 
49 52
 
50 53
 # set the number of digits shown in all output
5  Health Professional Shortage Areas/download current hpsa table.R
@@ -29,7 +29,10 @@
29 29
 # after downloading and importing it.
30 30
 # use forward slashes instead of back slashes
31 31
 
32  
-setwd( "C:/My Directory/HPSA/" )
  32
+# uncomment this line by removing the `#` at the front..
  33
+# setwd( "C:/My Directory/HPSA/" )
  34
+# ..in order to set your current working directory
  35
+
33 36
 
34 37
 
35 38
 
5  Health Professional Shortage Areas/identify point-in-time geographic hpsas.R
@@ -57,7 +57,10 @@
57 57
 # after downloading and importing it.
58 58
 # use forward slashes instead of back slashes
59 59
 
60  
-setwd( "C:/My Directory/HPSA/" )
  60
+# uncomment this line by removing the `#` at the front..
  61
+# setwd( "C:/My Directory/HPSA/" )
  62
+# ..in order to set your current working directory
  63
+
61 64
 
62 65
 
63 66
 
5  Health Professional Shortage Areas/replicate hrsa nationwide statistics.R
@@ -48,7 +48,10 @@
48 48
 # after downloading and importing it.
49 49
 # use forward slashes instead of back slashes
50 50
 
51  
-setwd( "C:/My Directory/HPSA/" )
  51
+# uncomment this line by removing the `#` at the front..
  52
+# setwd( "C:/My Directory/HPSA/" )
  53
+# ..in order to set your current working directory
  54
+
52 55
 
53 56
 
54 57
 # load the primary care physician HPSA file
5  Health and Retirement Study/1992 - 2010 download HRS microdata.R
@@ -59,7 +59,10 @@ your.password <- "password"
59 59
 # after downloading.
60 60
 # use forward slashes instead of back slashes
61 61
 
62  
-setwd( "C:/My Directory/HRS/" )
  62
+# uncomment this line by removing the `#` at the front..
  63
+# setwd( "C:/My Directory/HRS/" )
  64
+# ..in order to set your current working directory
  65
+
63 66
 
64 67
 
65 68
 # remove the # in order to run this install.packages line only once
11  Health and Retirement Study/import example HRS file.R
@@ -38,12 +38,15 @@
38 38
 # import a single HRS file into R, then save that file as an R data file (.rda) for faster loading later #
39 39
 ##########################################################################################################
40 40
 
  41
+# uncomment this line by removing the `#` at the front..
  42
+# setwd( "C:/My Directory/HRS/" )
  43
+# ..in order to set your current working directory
41 44
 
42 45
 # filepath to a fixed-width file produced by the university of michigan
43  
-fn <- "C:/My Directory/HRS/download/1992/h92core/h92da/HOUSEHLD.DA"
  46
+fn <- "./download/1992/h92core/h92da/HOUSEHLD.DA"
44 47
 
45 48
 # filepath to the SAS importation instructions for that fixed-width file
46  
-sas.input <- "C:/My Directory/HRS/download/1992/h92core/h92sas/HOUSEHLD.SAS"
  49
+sas.input <- "./download/1992/h92core/h92sas/HOUSEHLD.SAS"
47 50
 
48 51
 
49 52
 
@@ -126,7 +129,7 @@ head( x )
126 129
 tail( x )
127 130
 
128 131
 # finally, save the data frame as a '.rda' file for ultra-fast loading in the future.
129  
-save( x , file = 'C:/My Directory/HRS/household.rda' )
  132
+save( x , file = 'household.rda' )
130 133
 
131 134
 
132 135
 ######################################################
@@ -134,7 +137,7 @@ save( x , file = 'C:/My Directory/HRS/household.rda' )
134 137
 ######################################################
135 138
 
136 139
 
137  
-load( 'C:/My Directory/HRS/household.rda' )
  140
+load( 'household.rda' )
138 141
 
139 142
 # count the number of records in x
140 143
 nrow( x )
5  Health and Retirement Study/import longitudinal RAND contributed files.R
@@ -39,7 +39,10 @@
39 39
 # all HRS data files should have been stored within a download/ folder here
40 40
 # use forward slashes instead of back slashes
41 41
 
42  
-setwd( "C:/My Directory/HRS/" )
  42
+# uncomment this line by removing the `#` at the front..
  43
+# setwd( "C:/My Directory/HRS/" )
  44
+# ..in order to set your current working directory
  45
+
43 46
 
44 47
 # choose the name of the database
45 48
 db.name <- 'RAND.db'
5  Health and Retirement Study/longitudinal RAND - analysis examples.R
@@ -35,7 +35,10 @@
35 35
 # the SQLite database file should have been stored within this folder
36 36
 # use forward slashes instead of back slashes
37 37
 
38  
-setwd( "C:/My Directory/HRS/" )
  38
+# uncomment this line by removing the `#` at the front..
  39
+# setwd( "C:/My Directory/HRS/" )
  40
+# ..in order to set your current working directory
  41
+
39 42
 
40 43
 # remove the # in order to run this install.packages line only once
41 44
 # install.packages( "survey" )
5  Health and Retirement Study/replicate 2002 regression.R
@@ -47,7 +47,10 @@
47 47
 # the SQLite database file should have been stored within this folder
48 48
 # use forward slashes instead of back slashes
49 49
 
50  
-setwd( "C:/My Directory/HRS/" )
  50
+# uncomment this line by removing the `#` at the front..
  51
+# setwd( "C:/My Directory/HRS/" )
  52
+# ..in order to set your current working directory
  53
+
51 54
 
52 55
 # remove the # in order to run this install.packages line only once
53 56
 # install.packages( "survey" )
7  Medical Expenditure Panel Survey/1996-2010 household component - download all microdata.R
@@ -28,7 +28,10 @@
28 28
 # after downloading.
29 29
 # use forward slashes instead of back slashes
30 30
 
31  
-setwd( "C:/My Directory/MEPS/" )
  31
+# uncomment this line by removing the `#` at the front..
  32
+# setwd( "C:/My Directory/MEPS/" )
  33
+# ..in order to set your current working directory
  34
+
32 35
 
33 36
 
34 37
 # remove the # in order to run this install.packages line only once
@@ -370,7 +373,7 @@ for ( i in nrow( mm ):1 ) {
370 373
 }
371 374
 
372 375
 # print a reminder: set the directory you just saved everything to as read-only!
373  
-winDialog( 'ok' , paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
  376
+message( paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
374 377
 
375 378
 
376 379
 # for more details on how to work with data in r
5  Medical Expenditure Panel Survey/2010 consolidated - analyze with brr.R
@@ -66,7 +66,10 @@
66 66
 # created by the R program specified above
67 67
 # use forward slashes instead of back slashes
68 68
 
69  
-setwd( "C:/My Directory/MEPS/" )
  69
+# uncomment this line by removing the `#` at the front..
  70
+# setwd( "C:/My Directory/MEPS/" )
  71
+# ..in order to set your current working directory
  72
+
70 73
 
71 74
 
72 75
 # remove the # in order to run this install.packages line only once
5  Medical Expenditure Panel Survey/2010 consolidated - analyze with tsl.R
@@ -66,7 +66,10 @@
66 66
 # created by the R program specified above
67 67
 # use forward slashes instead of back slashes
68 68
 
69  
-setwd( "C:/My Directory/MEPS/" )
  69
+# uncomment this line by removing the `#` at the front..
  70
+# setwd( "C:/My Directory/MEPS/" )
  71
+# ..in order to set your current working directory
  72
+
70 73
 
71 74
 
72 75
 # remove the # in order to run this install.packages line only once
18  MonetDB/monetdb database creation instructions.R
@@ -14,28 +14,14 @@
14 14
 # if you've successfully installed monetdb to your machine,
15 15
 # you should be able to initiate your first database with these commands:
16 16
 
17  
-
  17
+require(downloader)	# downloads and then runs the source() function on scripts from github
18 18
 require(RMonetDB)	# load the RMonetDB package (connects r to a monet database)
19 19
 
20 20
 
21  
-#######################################################	
22  
-# function to download scripts directly from github.com
23  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
24  
-source_https <- function(url, ...) {
25  
-  # load package
26  
-  require(RCurl)
27  
-
28  
-  # parse and evaluate each .R script
29  
-  sapply(c(url, ...), function(u) {
30  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
31  
-  })
32  
-}
33  
-#######################################################
34  
-
35 21
 # load the windows.monetdb.configuration() function,
36 22
 # which allows the easy creation of an executable (.bat) file
37 23
 # to run the monetdb server specific to this data
38  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
  24
+source_url( "https://raw.github.com/ajdamico/usgsd/master/MonetDB/windows.monetdb.configuration.R" )
39 25
 
40 26
 
41 27
 # run the windows.monetdb.configuration() function to
2  MonetDB/monetdb installation instructions.R
@@ -32,4 +32,4 @@
32 32
 # open up your R console and run these two separate installation commands without the # sign in front:
33 33
 # install.packages("RMonetDB" , repos = c( "http://cran.r-project.org" , "http://R-Forge.R-project.org" ) , dep=TRUE )
34 34
 # install.packages("sqlsurvey" , repos = c( "http://cran.r-project.org" , "http://R-Forge.R-project.org" ) , dep=TRUE )
35  
-# install.packages( c( 'SAScii' , 'descr' , 'survey' , 'RCurl' ) )
  35
+# install.packages( c( 'SAScii' , 'descr' , 'survey' , 'downloader' ) )
4  National Health Interview Survey/2011 personsx - analyze.R
@@ -43,7 +43,9 @@
43 43
 # then the working directory should be set to "C:/My Directory/NHIS/"
44 44
 # use forward slashes instead of back slashes
45 45
 
46  
-setwd( "C:/My Directory/NHIS/" )
  46
+# uncomment this line by removing the `#` at the front..
  47
+# setwd( "C:/My Directory/NHIS/" )
  48
+# ..in order to set your current working directory
47 49
 
48 50
 
49 51
 # remove the # in order to run this install.packages line only once
5  National Health Interview Survey/2011 personsx plus samadult with multiple imputation - analyze.R
@@ -43,7 +43,10 @@
43 43
 # then the working directory should be set to "C:/My Directory/NHIS/"
44 44
 # use forward slashes instead of back slashes
45 45
 
46  
-setwd( "C:/My Directory/NHIS/" )
  46
+# uncomment this line by removing the `#` at the front..
  47
+# setwd( "C:/My Directory/NHIS/" )
  48
+# ..in order to set your current working directory
  49
+
47 50
 
48 51
 
49 52
 # remove the # in order to run this install.packages line only once
4  National Health Interview Survey/replicate cdc tecdoc - 2000 multiple imputation.R
@@ -34,7 +34,9 @@
34 34
 # will be stored here after downloading and importing them.
35 35
 # use forward slashes instead of back slashes
36 36
 
37  
-setwd( "C:/My Directory/NHIS/" )
  37
+# uncomment this line by removing the `#` at the front..
  38
+# setwd( "C:/My Directory/NHIS/" )
  39
+# ..in order to set your current working directory
38 40
 
39 41
 
40 42
 # remove the # in order to run this install.packages line only once
5  National Health and Nutrition Examination Survey/2009-2010 interview only - download and analyze.R
@@ -26,7 +26,10 @@
26 26
 # after downloading and importing.
27 27
 # use forward slashes instead of back slashes
28 28
 
29  
-setwd( "C:/My Directory/NHANES/" )
  29
+# uncomment this line by removing the `#` at the front..
  30
+# setwd( "C:/My Directory/NHANES/" )
  31
+# ..in order to set your current working directory
  32
+
30 33
 
31 34
 
32 35
 # set the number of digits shown in all output
5  ...nal Health and Nutrition Examination Survey/2009-2010 interview plus laboratory - download and analyze.R
@@ -32,7 +32,10 @@
32 32
 # after downloading and importing.
33 33
 # use forward slashes instead of back slashes
34 34
 
35  
-setwd( "C:/My Directory/NHANES/" )
  35
+# uncomment this line by removing the `#` at the front..
  36
+# setwd( "C:/My Directory/NHANES/" )
  37
+# ..in order to set your current working directory
  38
+
36 39
 
37 40
 
38 41
 # set the number of digits shown in all output
5  National Health and Nutrition Examination Survey/replicate 2005-2008 pooled cdc oral examination figure.R
@@ -34,7 +34,10 @@
34 34
 # after downloading and importing.
35 35
 # use forward slashes instead of back slashes
36 36
 
37  
-setwd( "C:/My Directory/NHANES/" )
  37
+# uncomment this line by removing the `#` at the front..
  38
+# setwd( "C:/My Directory/NHANES/" )
  39
+# ..in order to set your current working directory
  40
+
38 41
 
39 42
 
40 43
 # set the number of digits shown in all output
5  National Health and Nutrition Examination Survey/replicate cdc publications.R
@@ -60,7 +60,10 @@
60 60
 # after downloading and importing.
61 61
 # use forward slashes instead of back slashes
62 62
 
63  
-setwd( "C:/My Directory/NHANES/" )
  63
+# uncomment this line by removing the `#` at the front..
  64
+# setwd( "C:/My Directory/NHANES/" )
  65
+# ..in order to set your current working directory
  66
+
64 67
 
65 68
 
66 69
 # set the number of digits shown in all output
7  National Survey on Drug Use and Health/1979-2011 - download all microdata.R
@@ -54,7 +54,10 @@
54 54
 # after downloading and importing it.
55 55
 # use forward slashes instead of back slashes
56 56
 
57  
-setwd( "C:/My Directory/NSDUH/" )
  57
+# uncomment this line by removing the `#` at the front..
  58
+# setwd( "C:/My Directory/NSDUH/" )
  59
+# ..in order to set your current working directory
  60
+
58 61
 
59 62
 
60 63
 # remove the # in order to run this install.packages line only once
@@ -284,7 +287,7 @@ for ( i in rev( seq( nrow( studies.by.year ) ) ) ){
284 287
 
285 288
 
286 289
 # print a reminder: set the directory you just saved everything to as read-only!
287  
-winDialog( 'ok' , paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
  290
+message( paste( "all done.  you should set" , getwd() , "read-only so you don't accidentally alter these files." ) )
288 291
 
289 292
 
290 293
 # for more details on how to work with data in r
5  National Survey on Drug Use and Health/2010 single-year - analysis examples.R
@@ -41,7 +41,10 @@
41 41
 # then the working directory should be set to "C:/My Directory/NSDUH/"
42 42
 # use forward slashes instead of back slashes
43 43
 
44  
-setwd( "C:/My Directory/NSDUH/" )
  44
+# uncomment this line by removing the `#` at the front..
  45
+# setwd( "C:/My Directory/NSDUH/" )
  46
+# ..in order to set your current working directory
  47
+
45 48
 
46 49
 
47 50
 # remove the # in order to run this install.packages line only once
5  National Survey on Drug Use and Health/replicate samhsa puf.R
@@ -54,7 +54,10 @@
54 54
 # then the working directory should be set to "C:/My Directory/NSDUH/"
55 55
 # use forward slashes instead of back slashes
56 56
 
57  
-setwd( "C:/My Directory/NSDUH/" )
  57
+# uncomment this line by removing the `#` at the front..
  58
+# setwd( "C:/My Directory/NSDUH/" )
  59
+# ..in order to set your current working directory
  60
+
58 61
 
59 62
 
60 63
 # remove the # in order to run this install.packages line only once
5  Survey of Consumer Finances/1989-2010 download all microdata.R
@@ -41,7 +41,10 @@ years.to.download <- c( 1989 , 1992 , 1995 , 1998 , 2001 , 2004 , 2007 , 2009 ,
41 41
 # after downloading.
42 42
 # use forward slashes instead of back slashes
43 43
 
44  
-setwd( "C:/My Directory/SCF/" )
  44
+# uncomment this line by removing the `#` at the front..
  45
+# setwd( "C:/My Directory/SCF/" )
  46
+# ..in order to set your current working directory
  47
+
45 48
 
46 49
 
47 50
 # no need to edit anything below this line #
25  Survey of Consumer Finances/2010 analysis examples.R
@@ -34,16 +34,19 @@
34 34
 # set your working directory.
35 35
 # the SCF 2010 R data file (scf2010.rda) should have been stored in this folder.
36 36
 
37  
-setwd( "C:/My Directory/SCF/" )
  37
+# uncomment this line by removing the `#` at the front..
  38
+# setwd( "C:/My Directory/SCF/" )
  39
+# ..in order to set your current working directory
  40
+
38 41
 
39 42
 
40 43
 # remove the # in order to run this install.packages line only once
41  
-# install.packages( c( 'mitools' , 'survey' , 'RCurl' ) )
  44
+# install.packages( c( 'mitools' , 'survey' , 'downloader' ) )
42 45
 
43 46
 
44 47
 require(mitools)	# allows analysis of multiply-imputed survey data
45 48
 require(survey)		# load survey package (analyzes complex design surveys)
46  
-require(RCurl)		# load RCurl package (downloads files from the web)
  49
+require(downloader)	# downloads and then runs the source() function on scripts from github
47 50
 require(foreign) 	# load foreign package (converts data files into R)
48 51
 
49 52
 
@@ -82,23 +85,9 @@ gc()
82 85
 # turn off scientific notation in most output
83 86
 options( scipen = 20 )
84 87
 
85  
-#######################################################
86  
-# function to download scripts directly from github.com
87  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
88  
-source_https <- function(url, ...) {
89  
-  # load package
90  
-  require(RCurl)
91  
-
92  
-  # parse and evaluate each .R script
93  
-  sapply(c(url, ...), function(u) {
94  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
95  
-  })
96  
-}
97  
-#######################################################
98  
-
99 88
 
100 89
 # load two svyttest functions (one to conduct a df-adjusted t-test and one to conduct a multiply-imputed t-test)
101  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/Survey%20of%20Consumer%20Finances/scf.survey.R" )
  90
+source_url( "https://raw.github.com/ajdamico/usgsd/master/Survey%20of%20Consumer%20Finances/scf.survey.R" )
102 91
 # now that this function has been loaded into r, you can view its source code by uncommenting the line below
103 92
 # scf.MIcombine
104 93
 # scf.svyttest
25  Survey of Consumer Finances/replicate FRB SAS output.R
@@ -56,16 +56,19 @@
56 56
 # set your working directory.
57 57
 # the SCF 2010 R data file (scf2010.rda) should have been stored in this folder.
58 58
 
59  
-setwd( "C:/My Directory/SCF/" )
  59
+# uncomment this line by removing the `#` at the front..
  60
+# setwd( "C:/My Directory/SCF/" )
  61
+# ..in order to set your current working directory
  62
+
60 63
 
61 64
 
62 65
 # remove the # in order to run this install.packages line only once
63  
-# install.packages( c( 'mitools' , 'survey' , 'Hmisc' , 'RCurl' ) )
  66
+# install.packages( c( 'mitools' , 'survey' , 'Hmisc' , 'downloader' ) )
64 67
 
65 68
 
66 69
 require(mitools)	# allows analysis of multiply-imputed survey data
67 70
 require(survey)		# load survey package (analyzes complex design surveys)
68  
-require(RCurl)		# load RCurl package (downloads files from the web)
  71
+require(downloader)	# downloads and then runs the source() function on scripts from github
69 72
 require(foreign) 	# load foreign package (converts data files into R)
70 73
 require(Hmisc) 		# load Hmisc package (loads a simple wtd.quantile function)
71 74
 
@@ -106,23 +109,9 @@ gc()
106 109
 # turn off scientific notation in most output
107 110
 options( scipen = 20 )
108 111
 
109  
-#######################################################
110  
-# function to download scripts directly from github.com
111  
-# http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
112  
-source_https <- function(url, ...) {
113  
-  # load package
114  
-  require(RCurl)
115  
-
116  
-  # parse and evaluate each .R script
117  
-  sapply(c(url, ...), function(u) {
118  
-    eval(parse(text = getURL(u, followlocation = TRUE, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))), envir = .GlobalEnv)
119  
-  })
120  
-}
121  
-#######################################################
122  
-
123 112
 
124 113
 # load two svyttest functions (one to conduct a df-adjusted t-test and one to conduct a multiply-imputed t-test)
125  
-source_https( "https://raw.github.com/ajdamico/usgsd/master/Survey%20of%20Consumer%20Finances/scf.survey.R" )
  114
+source_url( "https://raw.github.com/ajdamico/usgsd/master/Survey%20of%20Consumer%20Finances/scf.survey.R" )
126 115
 # now that this function has been loaded into r, you can view its source code by uncommenting the line below
127 116
 # scf.MIcombine
128 117
 # scf.svyttest
25  Survey of Income and Program Participation/1996 panel - download and create database.R
@@ -29,11 +29,14 @@
29 29
 # after downloading and importing.
30 30
 # use forward slashes instead of back slashes
31 31
 
32  
-setwd( "C:/My Directory/SIPP/" )
  32
+# uncomment this line by removing the `#` at the front..
  33
+# setwd( "C:/My Directory/SIPP/" )
  34
+# ..in order to set your current working directory
  35
+
33 36
 
34 37
 
35 38
 # remove the # in order to run this install.packages line only once
36  
-# install.packages( c( "RSQLite" , "SAScii" , "descr" ) )
  39
+# install.packages( c( "RSQLite" , "SAScii" , "descr" , "downloader" ) )
37 40
 
38 41
 
39 42
 SIPP.dbname <- "SIPP96.db"											# choose the name of the database (.db) file on the local disk
@@ -55,6 +58,7 @@ sipp.pnl.longitudinal.replicate.weights <- 'pnl'					# set to NULL to prevent do
55 58
 
56 59
 require(RSQLite) 	# load RSQLite package (creates database files in R)
57 60
 require(SAScii) 	# load the SAScii package (imports ascii data with a SAS script)
  61
+require(downloader)	# downloads and then runs the source() function on scripts from github
58 62
 
59 63
 
60 64
 # open the connection to the sqlite database
@@ -151,22 +155,9 @@ fix.repwgt <-
151 155
 	}
152 156
 ##################################################################################