Skip to content

Instantly share code, notes, and snippets.

@byanuaria
byanuaria / plot5.R
Created August 14, 2018 23:28
Plotting for question 5 in Exploratory Data Analysis
# reading in data
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# load packages
library(tidyverse)
# convert to proper class
SCC$SCC <- as.character(SCC$SCC)
SCC$EI.Sector <- as.character(SCC$EI.Sector)
@byanuaria
byanuaria / plot6.R
Last active August 15, 2018 17:53
Using EDA to compare emissions from motor vehicle sources in Baltimore City with emissions from motor vehicle sources in Los Angeles, CA. Graph shows which city has seen greater changes over time in motor vehicle emissions.
# read in data
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# load packages
library(tidyverse)
# convert to proper class
SCC$SCC <- as.character(SCC$SCC)
SCC$EI.Sector <- as.character(SCC$EI.Sector)
library(pitchRx)
library(tidyverse)
data <- scrape(start = "2011-04-04", end = "2011-06-01")
pitches <- data[["pitch"]]
ab <- data[["atbat"]]
newDat <- merge(pitches, ab, by = c("num", "gameday_link"))
newDat <- newDat[1:95]
@byanuaria
byanuaria / bisectionSearch.py
Created September 17, 2018 17:59
Guessing number using bisection search
low = 0
high = 100
guess = (low + high) // 2
ans = ""
userInput = input('Please think of a number between 0 and 100!')
while True:
print('Is Your secret number ' + str(guess) + '?')
ans = input("Enter 'h' to indicate the guess is too high. Enter 'l' to indicate the guess is too low. Enter 'c' to indicate I guessed correctly. ")
if ans == 'c':