Skip to content

Instantly share code, notes, and snippets.

View aurora-mareviv's full-sized avatar

aurora-mareviv

View GitHub Profile
library(tidyverse)
library(tidytext)
library(wordcloud)
library(reshape2)
library(tidygraph)
library(ggraph)
gdpr_text <- readr::read_tsv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-04-21/gdpr_text.tsv')
#base on https://www.tidytextmining.com/sentiment.html
@aurora-mareviv
aurora-mareviv / cSplit.R
Last active August 29, 2015 14:07 — forked from mrdwab/cSplit.R
cSplit <- function(indt, splitCols, sep = ",", direction = "wide",
makeEqual = NULL, fixed = TRUE, drop = TRUE,
stripWhite = FALSE) {
## requires data.table >= 1.8.11
require(data.table)
if (!is.data.table(indt)) setDT(indt)
if (is.numeric(splitCols)) splitCols <- names(indt)[splitCols]
if (any(!vapply(indt[, splitCols, with = FALSE],
is.character, logical(1L)))) {
indt[, eval(splitCols) := lapply(.SD, as.character),