From d41f91b60b76b3186ddc4b72abed4dbb9193e544 Mon Sep 17 00:00:00 2001 From: Zach Stednick Date: Mon, 25 Nov 2013 16:49:57 -0800 Subject: [PATCH] file opened in 'rb' mode resolves Issue #16 --- 03-Classification/email_classify.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03-Classification/email_classify.R b/03-Classification/email_classify.R index 2378cae..0e3c9e6 100644 --- a/03-Classification/email_classify.R +++ b/03-Classification/email_classify.R @@ -59,7 +59,7 @@ ggsave(plot = ex1, # words as features get.msg <- function(path) { - con <- file(path, open = "rt", encoding = "latin1") + con <- file(path, open = "rb", encoding = "latin1") text <- readLines(con) # The message always begins after the first full line break msg <- text[seq(which(text == "")[1] + 1, length(text), 1)]