I am using renv for this project and everything was working fine. I think the .Rprofile created by renv got corrupted. Now I can't open or delete that .Rprofile.
I tried accessing the file but the file can't be opened.
> usethis::edit_r_profile(scope = c("project"))
Error: [EACCES] Failed to open '/rwi/users/ushrestha/github/dh_inidcation_catalog/Batch Cohort Application/.Rprofile': permission denied
I am not able to activate renv now.
renv::activate()
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file '/rwi/users/ushrestha/github/dh_inidcation_catalog/Batch Cohort Application/.Rprofile': Permission denied
How can I restore the .Rprofile. I have tried to delete, edit the file but it's not working. I am also not able to change the github repo branch or go to the previous commit.
I am using renv for this project and everything was working fine. I think the .Rprofile created by renv got corrupted. Now I can't open or delete that .Rprofile.
I tried accessing the file but the file can't be opened.
> usethis::edit_r_profile(scope = c("project"))
Error: [EACCES] Failed to open '/rwi/users/ushrestha/github/dh_inidcation_catalog/Batch Cohort Application/.Rprofile': permission denied
I am not able to activate renv now.
renv::activate()
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file '/rwi/users/ushrestha/github/dh_inidcation_catalog/Batch Cohort Application/.Rprofile': Permission denied
How can I restore the .Rprofile. I have tried to delete, edit the file but it's not working. I am also not able to change the github repo branch or go to the previous commit.
Share Improve this question edited Mar 31 at 21:16 sutsabs asked Mar 31 at 21:01 sutsabssutsabs 4273 silver badges16 bronze badges1 Answer
Reset to default 0In a new posit session when opened the same project, I was able to activate the renv and create the Rprofile.
setwd("path/to/your/home/directory") # Change to a directory where you have write access
# Activate renv
renv::activate()
file.create(".Rprofile")
After this the renv worked fine and I was also able to update the git repo.
# Restore the environment
renv::restore()