Link to home
Start Free TrialLog in
Avatar of sirisha pujala
sirisha pujala

asked on

to export the data to a "csv file" from R

write.csv(df,file="~C:/Users/anitha/Documents/social_media analysis/socialmedia/tweets.csv",row.names=FALSE,append = TRUE)
Error in file(file, ifelse(append, "a", "w")) :
  cannot open the connection
Avatar of Allan Nisbet
Allan Nisbet
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you try a test to see if the path works

file.exists("~C:/Users/anitha/Documents/social_media analysis/socialmedia/tweets.csv")

Open in new window


I am unsure of the "~"

Also make sure you run R in Adminstrator mode as in wondows C drive is normally protected so you will sometimes get errors due to permissions not letting you access files in windows folders.

Hope this Helps
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.