Reputation: 103
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 ?
Upvotes: 1
Views: 1121
Reputation: 31
That is because a .csv file is a text file, not restricted for use in Excel only
Upvotes: 0
Reputation: 103
Actually if i use "connect to text file" instead of connect to Excel" and then select the .csv file, it works, lol. thanks though.
Upvotes: 3