Skip to content

Instantly share code, notes, and snippets.

View mGalarnyk's full-sized avatar

Michael Galarnyk mGalarnyk

View GitHub Profile
@mGalarnyk
mGalarnyk / quiz3.md
Created March 7, 2017 18:11
Getting and Cleaning Data Quiz 3 (Week 3) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/3_Getting_and_Cleaning_Data

Getting and Cleaning Data Quiz 3 (JHU) Coursera

Question 1

The American Community Survey distributes downloadable data about United States communities. Download the 2006 microdata survey about housing for the state of Idaho using download.file() from here:

https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv

and load the data into R. The code book, describing the variable names is here:

@mGalarnyk
mGalarnyk / quiz2.md
Created March 7, 2017 18:07
Getting and Cleaning Data Quiz 1 (Week 1) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/3_Getting_and_Cleaning_Data

Getting and Cleaning Data Quiz 2 (JHU) Coursera

Question 1

Register an application with the Github API here https://github.com/settings/applications. Access the API to get information on your instructors repositories (hint: this is the url you want "https://api.github.com/users/jtleek/repos"). Use this data to find the time that the datasharing repo was created. What time was it created? This tutorial may be useful (https://github.com/hadley/httr/blob/master/demo/oauth2-github.r). You may also need to run the code in the base R package and not R studio.

Since many people had issues with this I wrote a blog post on how to do this question: Github API using R

@mGalarnyk
mGalarnyk / quiz1.md
Created March 7, 2017 18:04
Getting and Cleaning Data Quiz 1 (Week 1) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/3_Getting_and_Cleaning_Data

Getting and Cleaning Data Quiz 1 (JHU) Coursera

Question 1

The American Community Survey distributes downloadable data about United States communities. Download the 2006 microdata survey about housing for the state of Idaho using download.file() from here:

https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv

and load the data into R. The code book, describing the variable names is here:

@mGalarnyk
mGalarnyk / assignment3.md
Last active October 25, 2025 06:35
R Programming Programming Assignment 3 (Week 4) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera
@mGalarnyk
mGalarnyk / assignment1.md
Last active September 11, 2023 08:00
R Programming Programming Assignment 1 (Week 2) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Project 1

github repo for rest of specialization: Data Science Coursera

For this first programming assignment you will write three functions that are meant to interact with dataset that accompanies this assignment. The dataset is contained in a zip file specdata.zip that you can download from the Coursera web site.

Although this is a programming assignment, you will be assessed using a separate quiz.

The zip file containing the data can be downloaded here: specdata.zip [2.4MB]

@mGalarnyk
mGalarnyk / quiz4.md
Last active February 21, 2024 09:50
R Programming Quiz 4 (Week 4) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 4

github repo for rest of specialization: Data Science Coursera

Question 1

What is produced at the end of this snippet of R code?

set.seed(1)
@mGalarnyk
mGalarnyk / quiz3.md
Last active December 8, 2024 18:06
R Programming Quiz 3 (Week 3) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 3

github repo for rest of specialization: Data Science Coursera

Question 1

Take a look at the 'iris' dataset that comes with R. The data can be loaded with the code:

library(datasets)
@mGalarnyk
mGalarnyk / quiz2.md
Last active June 13, 2023 09:01
R Programming Quiz 2 (Week 2) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 2

github repo for rest of specialization: Data Science Coursera

Question 1

Suppose I define the following function in R

@mGalarnyk
mGalarnyk / quiz1.md
Last active October 25, 2025 06:36
R Programming Quiz 1 (Week 1) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 1 (JHU) Coursera

github repo for rest of specialization: Data Science Coursera

Question 1

R was developed by statisticians working at...

Answer

The University of Auckland

@mGalarnyk
mGalarnyk / project2.md
Created March 5, 2017 23:40
Exploratory Data Analysis Project 2 (John Hopkins Data Science Coursera) for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/4_Exploratory_Data_Analysis

Exploratory Data Analysis Project 2 (JHU) Coursera

Unzipping and Loading Files

library("data.table")
path <- getwd()
download.file(url = "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
              , destfile = paste(path, "dataFiles.zip", sep = "/"))
unzip(zipfile = "dataFiles.zip")