This file contains hidden or 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
| Introduction to R | |
| ======================================================== | |
| This file is online! | |
| http://rpubs.com/alexplanation/dst4l | |
| https://gist.github.com/alexstorer/5460479 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
This file contains hidden or 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
| time seconds | |
| 1365781233.31362 0.815643072128296 | |
| 1365781253.95795 0.829960107803345 | |
| 1365781332.08635 0.819650888442993 | |
| 1365781371.6965 0.817964792251587 | |
| 1365781407.32883 1.21638607978821 |
This file contains hidden or 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
| # Run the topics script first to load everything up. | |
| npi[npidtm$fd>0,c('NPI_Description','aotitle',"plocstatename","ploccityname")] | |
| outp <- textvec[grep('FD',textvec)] | |
| grep('FIRE',outp) | |
| outp[grep('FIRE',outp,invert=TRUE)] | |
| npidtm$labelhospital <- 0 | |
| hospinds <- grep("HOSPITAL",textvec) |
This file contains hidden or 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
| # This is an exploration of topic modeling | |
| # First, let's load up this pile of things. | |
| Sys.setenv(NOAWT=TRUE) | |
| # This is a workaround for Macs | |
| library(tm) | |
| library(Snowball) |
This file contains hidden or 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 twitter | |
| import json | |
| import pickle | |
| import time | |
| import random | |
| import sys | |
| import csv | |
| import twitter__login | |
| # log in, and collect statuses containing a keyword |
This file contains hidden or 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
| fname <- 'a1.txt' | |
| ds <- read.csv(fname,col.names = c('Date','Time','File','TimeElapsed','SongTime'),header=FALSE,stringsAsFactors=FALSE) | |
| ds$Date <- as.Date(ds$Date) | |
| ds$Name <- fname | |
| timelist <- strsplit(ds$Time,split=':') | |
| for (i in 1:length(timelist)) { | |
| hr <- timelist[[i]][[1]] | |
| mn <- timelist[[i]][[2]] |
This file contains hidden or 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 type="text/javascript"> | |
| shuffle = function(o){ //v1.0 | |
| for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); | |
| return o; | |
| }; | |
| document.onkeyup = KeyCheck; | |
| var input = new Array(); |
This file contains hidden or 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
| <title>Alex's Webpage</title> | |
| <head> | |
| <style> | |
| body | |
| { | |
| background-color:#b0c4de; | |
| } | |
| h1 | |
| { | |
| background-color:#123456; |
This file contains hidden or 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
| from lxml import etree | |
| import re | |
| import csv | |
| import os.path as op | |
| import sys | |
| import glob | |
| class NLRPParse(object): | |
| def __init__(self,fname): |
This file contains hidden or 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
| setwd('~/Work/dlopez') | |
| r <- read.csv('Sampl.csv',stringsAsFactors=FALSE) | |
| # First, let's load up this pile of things. | |
| Sys.setenv(NOAWT=TRUE) | |
| # This is a workaround for Macs | |
| library(tm) |