0

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.

Trying to open the file

> 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

enter image description here

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.

1 Answer 1

0

In 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()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.