saving . . . saved I am getting an error while executing write.csv(captaincy,"NewCaptaincy") has been deleted. I am getting an error while executing write.csv(captaincy,"NewCaptaincy") has been hidden .
I am getting an error while executing write.csv(captaincy,"NewCaptaincy")
Title
Question
I am getting the following error while executing write.csv(captaincy,"NewCaptaincy.csv")

Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file 'NewCaptaincy.csv': Permission denied

Please advise.

Thank you

R Introduction-to-Data-Frames-in-R 07-08 min 10-20 sec 21-04-20, 3 p.m. hod_electronics@atharvacoe.ac.in

Answers:

This might be a permission issue on your computer. Please look at https://stackoverflow.com/questions/17156445/why-i-get-this-error-writing-data-to-a-file for debugging this issue. 
21-04-20, 3:44 p.m. sudhakarst
Thank you for the prompt reply. I found the solution through the help section in R Studio & by searching on google search engine with the same phrase & am posting it in answers section.

Once again thank you so much for the prompt reply.:)
21-04-20, 3:53 p.m. hod_electronics@atharvacoe.ac.in

Login to add comment


I am getting the following error while executing write.csv(captaincy,"NewCaptaincy.csv")

Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file 'NewCaptaincy.csv': Permission denied

The solution to above error is as below:

Go to RHS of R Studio Window & Locate Files (The tabs mentioned there are Files, Plots, Packages, Help, Viewer)
Click on Files
By default the location of file directory is C:/windows/system32 followed by ...
Click the ... after the file name
It will show the file path where you want to save the file (I Chose it as below)
I first created a folder named My Project on Desktop, Thereafter I chose the file path by clicking on ... on R Studio as C:/Users/Desktop/My Project
Thereafter, click on Settings icon just above ... & select set as working directory
Thereafter, execute the command  write.csv(captaincy,"NewCaptaincy.csv")

OR

In console window type:
setwd("C:/Users/Desktop/My Project") & press enter & execute your command write.csv(captaincy,"NewCaptaincy.csv")

The above solution worked for me, if anyone faces the same error, kindly give it a try.

Thank you...!!!
21-04-20, 4:05 p.m. hod_electronics@atharvacoe.ac.in


Log-in to answer to this question.