(source: http://nvie.com/posts/a-successful-git-branching-model/)
git checkout -b develop
git remote add origin git push origin develop git pull origin develop
(source: http://nvie.com/posts/a-successful-git-branching-model/)
git checkout -b develop
git remote add origin git push origin develop git pull origin develop
# remove non-ascii characters | |
df$text <- gsub("[^\x20-\x7E]", "", df$text) |
#' best package to read excel files is gdata | |
#' which works with both .xls and .xlsx | |
#' windows: follow instructions here: | |
#' http://cran.r-project.org/web/packages/gdata/INSTALL | |
library(gdata) | |
xlsx_file <- "myfile.xls" | |
sheet1 <- read.xls(xlsx_file, | |
sheet = "Sheet1", | |
stringsAsFactors = FALSE, |
### string matching | |
### metric to find the similarity between two strings | |
### some context in: | |
### http://en.wikipedia.org/wiki/String_metric | |
### testing levenshtein metric | |
library(RecordLinkage) |
# install.packages("rjson") | |
library("rjson") | |
json_file <- "json_file.json" | |
json_data <- fromJSON(paste(readLines(json_file), collapse="")) | |
# additional if needed | |
library(plyr) | |
json_data <- lapply(json_data, as.data.frame) | |
json_data <- do.call(rbind.fill, json_data) |
library(digest) | |
test <- c("hobe", "jmjj", 1) | |
digest(test, algo = "md5") | |
digest(test, algo = "sha1") | |
digest(test, algo = "crc32") # not collision proof | |
digest(test, algo = "sha256") | |
digest(test, algo = "sha512") |
plot(density(data1)) | |
lines(density(data2), col = blue) |
get_word_count <- function(string){ | |
length(unlist(strsplit(as.character(string), " "))) | |
} |
# windows | |
x <- read.delim(file("clipboard","r"), | |
header=TRUE, | |
stringsAsFactors = FALSE) | |
# mac | |
data <- read.table(pipe("pbpaste"), sep="\t", header=T) | |
# read from and write to clipboard with Kmisc (windows + OS X): | |
library(Kmisc) |
df <- data.frame(f = 1:4, g = letters[1:4]) | |
df$g <- factor(df$g, levels = letters[4:1]) |