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: "Using Gensim in R" | |
| author: "Adam Lauretig" | |
| date: "3/17/2018" | |
| output: html_document | |
| --- | |
| ```{r setup, include=FALSE} | |
| knitr::opts_chunk$set(echo = TRUE) | |
| ``` |
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
| #' A word vector is a giant matrix of words, and each word contains a numeric array that represents the semantic | |
| #' meaning of that word. This is useful so we can discover relationships and analogies between words programmatically. | |
| #' The classic example is "king" minus "man" plus "woman" is most similar to "queen" | |
| # function definition -------------------------------------------------------------------------- | |
| # input .txt file, exports list of list of values and character vector of names (words) | |
| proc_pretrained_vec <- function(p_vec) { |
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(doParallel) | |
| rpts <- list(list(out="one.html", params=list(some_var="One")), | |
| list(out="two.html", params=list(some_var="Two")), | |
| list(out="three.html", params=list(some_var="Three")), | |
| list(out="four.html", params=list(some_var="Four"))) | |
| do_rpt <- function(r) { | |
| require(rmarkdown) |
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
| # Command line tools don’t want to clutter their output with unnecessary noise. | |
| library = function (...) | |
| suppressMessages(base::library(...)) | |
| #' The command line arguments | |
| args = commandArgs(trailingOnly = TRUE) | |
| #' The name of the script | |
| #' | |
| #' @note If the script was invoked interactively, this is the empty string. |
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
| ''' | |
| @author Michael J Bommarito II | |
| @date Mar 2, 2010 | |
| This file can determine the average pairwise stability for | |
| a dynamic graph. Growing graphs, constant vertex count graphs, and | |
| even graphs with deleted vertices are supported. | |
| It supports the following methods: | |
| * betweenness |