Dear Visitors:

Please scroll down the page to see present and archive blogs.

Thank you very much: Tramway Null(0)

Webrings - Maps - Trolleys and More

Navigation by WebRing.
Showing posts with label American Community Survey. Show all posts
Showing posts with label American Community Survey. Show all posts

Monday, November 6, 2017

Data Scrapping for Transportation Info using "R"

Recently, I was exposed to data mining and data scrapping using "R" which is a statistical relating language which has geospatial capability.   In a recent "R" blog, it was shown how to use "R" to data scrape the US census information from the "American Community Survey" for 2015.  I found one variable that is transit related and it is labeled "PublicTrans".  I do not know what it measures but you are able to bring it up for selected cities using code.  There are over 500 variables dealing with the census and it is a nice resource to know about.  Some code is shown below.  More to follow.


Package‘census’ October 26, 2017
Type Package Title Scrape US Census Data Version 0.2.0 Maintainer Danny Malter <danmalter@gmail.com> Description A scraper to collect US Census data from the American Community Survey (ACS) data andmetadata.Availabledatasetsincludepopulation,income,educationandemploymentlevelsby age,sexandrace.See<http://mcdc.missouri.edu/websas/caps10acsb.html>formoreinformation. Unlike other census related packages, this package does not require a U.S. Census Bureau API. URL https://github.com/danmalter/census BugReports https://github.com/danmalter/census/issues Depends R (>= 3.2.0), ggmap, RCurl, utils Suggests knitr, rmarkdown, ggplot2, proto, RgoogleMaps, png, rjson, mapproj, jpeg, geosphere, bitops License MIT + file LICENSE Encoding UTF-8 LazyData true RoxygenNote 6.0.1 VignetteBuilder knitr NeedsCompilation no Author Danny Malter [aut, cre] Repository CRAN Date/Publication 2017-10-26 08:30:33 UTC
Rtopicsdocumented:
getCensus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Index 3
1
2 getCensus



df[1:5, c("sitename","radius","TotPop","pctMales","pctFemales","AvgFamInc","pctPrivWageWorkers","pctGovWorkers", "pctMarried","pctBachelors","MedianHValue","PublicTrans")]
   sitename radius    TotPop pctMales pctFemales AvgFamInc pctPrivWageWorkers pctGovWorkers pctMarried pctBachelors MedianHValue
1   Chicago     10 2,530,608     48.8       51.2   $87,982               84.7          10.4       35.0         21.8     $269,295
2  New York     10 6,933,559     48.1       51.9  $100,221               81.5          11.7       39.0         22.8     $604,431
3   Detroit     10   876,392     48.1       51.9   $51,019               85.0          10.4       28.9          9.4      $66,165
4   Seattle     10 1,035,736     50.2       49.8  $134,413               81.0          12.7       45.0         33.6     $498,553
NA     <NA>   <NA>      <NA>     <NA>       <NA>      <NA>               <NA>          <NA>       <NA>         <NA>         <NA>
   PublicTrans
1      330,175
2    1,829,436
3       18,024
4       96,355
NA        <NA>
sitename radius    TotPop pctMales pctFemales AvgFamInc pctPrivWageWorkers pctGovWorkers pctMarried pctBachelors MedianHValue PublicTrans
1       Chicago      8 1,815,448     49.2       50.8   $91,510               85.7           9.5       33.5         23.4     $293,622     261,837
2      New York      8 5,224,374     48.1       51.9  $109,275               81.8          11.2       38.6         24.4     $668,262   1,482,966
3       Detroit      8   536,864     48.2       51.8   $45,772               84.7          10.8       26.5          8.5      $59,365      12,835
4   Los Angeles      8 2,588,438     49.6       50.4   $64,993               79.8           9.4       36.1         17.0     $486,128     161,261
5       Seattle      8   750,999     50.2       49.8  $141,393               80.5          13.2       42.6         35.0     $526,929      78,862
6        Boston      8 1,426,011     48.1       51.9  $114,584               84.3          10.3       36.9         24.9     $481,422     214,912
7  Philadelphia      8 1,718,692     47.2       52.8   $73,323               83.6          12.1       30.4         15.8     $177,031     172,100

8 San Francisco      8 1,017,777     50.6       49.4  $134,464               79.6          11.7       40.0         31.7     $831,206     172,455