STAT 451, Day 8

Tools to Visualize Data

Design

Question: So what is the underlying design of the websites we have looked at?

Design

Answer: High level overview goes into more and more detail, and you can change the views yourself.

DataSF

Back to the DataSF website.

Question: What kind of data files can you download?

Question: Which areas of SF have smart meters? Search on “Parking meters” to find the Parking meters dataset.

Another website with SF data SFpark

DataSF

Answer: You can export to Carto, Plotly. You can download .csv, .xml.

And now you can access the data in .json format directly from R through an API.

install.packages(“RSocrata”)

library(RSocrata)

df <- read.socrata(“https://data.sfgov.org/resource/2iym-9kfb?\$$app_token=YOURAPPTOKENHERE”)

Answer: Make a map of SF with the Parking meters on it. Where are the Parking meters?

To use the API you need to create an account on the website.

Data and the Web

If you are going to work with data and the web, you are likely to run into data in JSON and XML formats.

  • Javascript object notation (JSON)
  • Extensible Markup Language (XML)
  • JSON and XML is commonly used with APIs
  • Application Programming Interface (API)

So if you going into writing apps, .

Data and the Web

Download the code for Chapter 2.

Examine

  • wunderdata.txt
  • wunderdata.xml
  • wunderdata.json

These are all .txt files. Looking at the files again, open each of them up.

New Related Software

Parking Example