{{ message }}

Instantly share code, notes, and snippets.

# Sean Krossseankross

Created Nov 11, 2012
Live R Coding with Cohen
View Session 1
 # Cohen setwd("~/Desktop/R") source("~/Desktop/R/floridaModel.R") floridaModel('F','GM',c(11,8,2011),c(11,8,2012))
Created Dec 2, 2012
Plots difference between two stocks
View R Plot Differences
 setwd('~/Desktop/R/Inputs') getYahooCsv <- function(startDate, endDate, ticker){ string <- paste("http://ichart.finance.yahoo.com/table.csv?s=",ticker, "&a=",startDate[1]-1,"&b=",startDate[2],"&c=",startDate[3], "&d=",endDate[1]-1,"&e=",endDate[2],"&f=",endDate[3],"&g=d&ignore=.csv", sep="") return (read.csv(string)) }
Last active May 24, 2020
Counting primes using the Sieve of Eratosthenes in R
View Sieve of Eratosthenes.R
 # The Sieve of Eratosthenes # Given a number greater than zero this function will return a list of primes between 2 and the number given as argument. sieveOfEratosthenes <- function(num){ values <- rep(TRUE, num) values[1] <- FALSE prev.prime <- 2 for(i in prev.prime:sqrt(num)){ values[seq.int(2 * prev.prime, num, prev.prime)] <- FALSE prev.prime <- prev.prime + min(which(values[(prev.prime + 1) : num]))
Created Aug 22, 2013
View Where to find data
 ## Universities Data and Story Librbary Berkley Data Lab UCLA Statistics Data Sets ## General Data freebase.com infochimps.org numbrary.com aggdata.com
Last active Dec 21, 2015
Making a histogram in R
View Histograms in R
 # Assuming you have a file called Workbook2.csv on your desktop Workbook2 <- read.table("~/Desktop/Workbook2.csv", quote="\"") colors = c("red", "yellow", "green", "violet", "orange") hist(Workbook2\$V1, main = "Title", xlab = "X-axis", ylab = "Y-axis", col = colors)
Last active Aug 13, 2019
Update a Github Fork from the Original Repo
View Update Fork.md

Taken from here

`git remote add --track master mleung git://github.com/mleung/feather.git`

Verify:

`git remote`

Created Feb 5, 2014
Initializing GitHub repository
View init.md

### Create a new repository on the command line

``````touch README.md
git init
git commit -m "first commit"