csv - R code suddenly stopped working in tidy text -
i trying word analysis on data in r. imported 1 column of data text responses survey r using read.csv. named 1 of columns "text" . code working fine few days ago , giving me error. code entering:
library(dplyr) library(tidytext) a1<-read.csv("/users/laura/documents/a1.csv") colnames(a1)= c("text") a1<-a1%>%unnest_tokens(word, text)
the error getting says this:
error in check_input(x) : input must character vector of length or list of character vectors, each of has length of 1.
my data didn't change, code i'm using didn't change. :( don't understand why happening , new r... there package need load maybe had loaded before , didn't realize it?
here link data: https://www.dropbox.com/s/amg12jp9qx98slz/a1.csv?dl=0
thanks help
i used data provided on dropbox , following code seems running me no problems. maybe try reading in not csv?
library(dplyr) library(tidytext) library(readr) a1 <- data_frame(text = read_lines("~/downloads/a1.csv")) %>% mutate(line = row_number()) tidya1 <- a1 %>% unnest_tokens(word, text) tidya1 #> # tibble: 332 × 2 #> line word #> <int> <chr> #> 1 1 empty #> 2 1 #> 3 1 cup #> 4 1 step #> 5 1 on #> 6 1 #> 7 1 line #> 8 2 safe #> 9 2 space #> 10 3 empty #> # ... 322 more rows
Comments
Post a Comment