1
votes

I have an R script which writes out a data frame into a file "file.csv". Here is the code:

tweetsdf <- gettweets(string,n)

tweetsdf$text <- gsub("@[[:alnum:]]+ *","",tweetsdf$text)
tweetsdf$text <- gsub("http[[:alnum:][:punct:]]+ *","",tweetsdf$text)
tweetsdf$text <- gsub("[^[:alpha:][:space:]]*","",tweetsdf$text)
tweetsdf$text <- gsub("[[:punct:]]","",tweetsdf$text)
tweetsdf$text <- gsub("\n","",tweetsdf$text)

tweetsdf$text <- tolower(tweetsdf$text)
write.csv(tweetsdf,"file.csv",row.names=F) 

When i try to import the file "file.csv" it into tableau public i get the error "Illegal file type for Excel Protocol". If i open the .csv file and save it as an excel workbook, only then i am able to import it into tableau public.

I tried everything, but nothing worked.

What am i doing Wrong ?

2

2 Answers

1
votes

Actually if i use "connect to text file" instead of connect to Excel" and then select the .csv file, it works, lol. thanks though.

0
votes

That is because a .csv file is a text file, not restricted for use in Excel only