This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
rfiles = os.listdir('.') | |
rc = [] | |
for f in rfiles: | |
if '.txt' in f: | |
# The recipes come in 3 txt files consisting of 1 recipe per line, the | |
# cuisine of the recipe as the first entry in the line, and all subsequent ingredient | |
# entries separated by a tab | |
infile = open(f, 'r') | |
rc.append(infile.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recipes = readLines('recipes combined.tsv') | |
# Once I read it into R, I have to get rid of the /t | |
# characters so that it's more acceptable to the tm package | |
recipes.new = apply(as.matrix(recipes), 1, function (x) gsub('\t',' ', x)) | |
recipes.corpus = Corpus(VectorSource(recipes.new)) | |
recipes.dtm = DocumentTermMatrix(recipes.corpus) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Python: 3.4.2 | |
author: dokenzy | |
date: 2015. 4. 21 | |
license: MIT License | |
""" | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(KoNLP) | |
library(wordcloud) | |
library(plyr) | |
library(ggplot2) | |
library(scales) | |
tw <- read.delim('./data/NIS.csv', header=T, sep=',', stringsAsFactors=F) | |
tw.RT <- read.delim('./data/NIS_RT.csv', header=T, sep=',', stringsAsFactors=F) | |
tw.all <- read.delim('./data/NIS_withRT.csv', header=T, sep=',', | |
stringsAsFactors=F) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Script for scraping Chronicling America | |
import requests | |
import re | |
import csv | |
from bs4 import BeautifulSoup, SoupStrainer | |
import os | |
from time import sleep | |
from datetime import date, datetime, timedelta | |
#search_terms is a string of words separated by spaces. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(tidyr) | |
library(magrittr) | |
library(ggplot2) | |
"http://academic.udayton.edu/kissock/http/Weather/gsod95-current/NYNEWYOR.txt" %>% | |
read.table() %>% data.frame %>% tbl_df -> data | |
names(data) <- c("month", "day", "year", "temp") | |
data %>% | |
group_by(year, month) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(shinydashboard) | |
library(sparkline) | |
library(httr) | |
library(jsonlite) | |
library(data.table) | |
library(dplyr) | |
library(rvest) | |
library(magrittr) | |
library(XML) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:6eedb0030499d0d2d3e9771cf5de62fde633f5875dd94bf121c4f7f2dc2849c1" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(mnormt) | |
mycols <- topo.colors(100,0.5) | |
xhat <- c(0.2, -0.2) | |
Sigma <- matrix(c(0.4, 0.3, | |
0.3, 0.45), ncol=2) | |
x1 <- seq(-2, 4,length=151) | |
x2 <- seq(-4, 2,length=151) | |
f <- function(x1,x2, mean=xhat, varcov=Sigma) | |
dmnorm(cbind(x1,x2), mean,varcov) | |
z <- outer(x1,x2, f) |