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
getPackage <- function(pkg){ | |
if(!require(pkg, character.only=TRUE)){ | |
install.packages(pkg, dependencies=TRUE) | |
library(pkg, character.only=TRUE) | |
} | |
return(TRUE) | |
} | |
getPackages <- function(pkgs){ | |
for (pkg in pkgs){ |
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 nltk, glob | |
for filename in glob.glob( '*.htm*' ): | |
filein = open(filename) | |
html = filein.read() | |
raw = nltk.clean_html(html) | |
fileout = open(filename.rstrip('.html')+'.txt', 'w+') | |
fileout.write(raw) |
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
<?php | |
class makeExt{ | |
protected $project = "<project>"; | |
protected $name = "<you>"; | |
protected $desc = "<insert a short description here>"; | |
public function __construct(){ | |
global $argv, $argc; |
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
## 213 YEARS OF POLITICAL EVOLUTION IN 60 SECONDS v4 | |
# Created: | |
## Jay Ulfelder | |
## October 1, 2012 | |
# Modified: | |
## Tony Boyles[[email protected]] | |
## March 20, 2014 |
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
library(foreign) | |
write.table(read.dta(file.choose()), file="output.csv", quote = FALSE, sep = ",") |
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
laggr <- function(x,y){return(c(rep(NA, y),x[-((length(x)-y+1):length(x))]))} |
NewerOlder