saving . . . saved writing .csv file has been deleted. writing .csv file has been hidden .
writing .csv file
Title
Question
<span style="background-color: rgb(255, 255, 204);">write.csv(captaincy,"NewCaptaincy.csv", row.names = FALSE)</span>
by using the above code, I am getting an error,
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
how to solve this?

R Introduction-to-Data-Frames-in-R 09-10 min 10-20 sec 09-11-19, 12:56 p.m. srilakjshmitn

Answers:

Try specifying the path where you want to save your file. 
09-11-19, 2:25 p.m. wangikarsmita2019@gmail.com


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.