From 552be5b84daeb8e573ffb003dee79d46f1dca6cb Mon Sep 17 00:00:00 2001 From: randef1ned <46381867+randef1ned@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:34:05 +0800 Subject: [PATCH] Avoid recognize single element as file path --- R/word2vec.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/word2vec.R b/R/word2vec.R index cc5e74c..a63dc81 100644 --- a/R/word2vec.R +++ b/R/word2vec.R @@ -129,7 +129,7 @@ word2vec <- function(x, on.exit({ if (file.exists(file_stopwords)) file.remove(file_stopwords) }) - if(length(x) == 1){ + if(length(x) == 1 && file.exists(x)){ file_train <- x }else{ file_train <- tempfile(pattern = "textspace_", fileext = ".txt")