Urban Big Data Analytics

Lecture 6
Cloud Computing

July 24, 2019

Instructor: Andy Hong, PhD
Lead Urban Health Scientist
The George Institute for Global Health
University of Oxford

Let's do the Assignment 3 together

  • Why bother to learn coding?
  • Reproducibility
  • Room for improvement
  • Let's cover some R basics first

R Basics - What are packges?

  • Add more functions
  • Written by global R users
  • From computation to visualization
  • New packages avialable for free

R Basics - What are packages?

R Packages

Installing packages:
install.packages("ggplot2")

Loading packages:
library(ggplot2)

R Studio

Vectors


				> x = c(1, 5, 4, 9, 0)
				>
				> length(x)
				[1] 5
				>
				> x = c(1, 5.4, TRUE, "hello")
				>
				> x
				[1] "1"   "5.4"   "TRUE"   "hello"
				

Lists


				> x = list(1, 2)
				> x
				[[1]]
				[1] 1

				[[2]]
				[1] 2
				> 
				> x = list("new","class")
				> x
				[[1]]
				[1] "new"

				[[2]]
				[1] "class"
				

Data Frames


				> x = data.frame(column1=c(1,2,3), column2=c("A","B","C"))
				> x
				  column1 column2
				1       1       A
				2       2       B
				3       3       C
				

Basic commands


				 > str(x)
				 'data.frame':	3 obs. of  2 variables:
				  $ column1: num  1 2 3
				  $ column2: Factor w/ 3 levels "A","B","C": 1 2 3
				 
				 > head(x)
				   column1 column2
				 1       1       A
				 2       2       B
				 3       3       C
				 
				 > View(x) # Note "V" is capitalized
				

Basic commands


				# Testing for equality in R using ==	
				> x = 1
				> if(x == 1) cat("x is 1!") else cat("x is not 1!")
				x is 1!
				
				# Boolean algebra: TRUE/FALSE statements and math operators:
				< means "less than"
				<= means "less than or equal"
				>= means "more than or equal"
				!= "not equal to"

				# Logical operators:
				& means “and”
				| means “or”
				

Let's dive into the Assignment 3

Cloud computing

What is cloud computing?

  • Computing services over the Internet (“the cloud”)
  • Charge based on usage, like electricity
  • Example:
    • Music streaming services
    • Storing/sharing files online
    • Turn on/off apps from cloud

Why cloud computing?

  1. Lower costs: no hardware/software
  2. Faster: quick to set up
  3. Scale on demand
  4. Little maintenance
  5. Reliable + backup

Big probem with cloud

Types of cloud services

  • Infrastructure-as-a-service (IaaS): servers, virtual machines, storage
  • Platform-as-a-service (PaaS): on-demand environment for development
  • Software-as-a-service (SaaS): host and manage softwares online
  • Database-as-a-service (DBaaS): building and managing database online

Database-as-a-Service

Cloud computing services

Google BigQuery

Google End-to-End Pipeline

Google BigQuery Demo

BigQuery Console (login required)

Group project Part 2

Instruction

Any questions?

For all the course materials, go to urbanbigdata.github.io