Created
August 12, 2019 16:53
-
-
Save tpaskhalis/9fa398b7af235fdc2a3b3eab5f6c0eff to your computer and use it in GitHub Desktop.
readtext_replacement.R
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
download.file("https://github.com/lse-me314/assignment09/blob/master/UKimmigTexts.zip?raw=true", destfile = "UKimmigTexts.zip") | |
unzip("UKimmigTexts.zip", exdir = "UKimmigTexts") | |
fls <- list.files("UKimmigTexts", full.names = TRUE) | |
txts <- character(length(fls)) | |
for (i in seq_along(fls)) { | |
txts[i] <- paste(readLines(fls[i]), collapse = " ") | |
} | |
mycorpus <- quanteda::corpus(txts, docnames = fls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment