I have taken my notes on codes on R project however now I cannot open the project anymore as it keeps giving me the error about 'line number 3 being invalid'. Does anybody know how I can solve this and access my notes on the R file?
I have a similar issue as the OP for a long used project which recently started throwing this error:
"Project '~/filepath/filename.Rproj' could not be opened: file line number 1 is invalid"
I was able to open the .Rproj file with Notepad ++ and it showed a single line (218 characters) of all 'NUL' (Ascii code 0 from what I can gather from the internet). Looking at other .Rproj files, the 'NUL' is different and, I assume, not good.
Looking at other .Rproj files, generally they all seem to have the same information on my machine:
"Version: 1.0
RnwWeave: Sweave
LaTeX: pdfLaTeX
"
With slight variation if its was related to a R package.
I was able to copy and paste the text from another .Rproj file into the corrupt .Rproj file and the project will open now.
Hopefully this will generally help.
Thank you for the detailed info and sharing the exprience, hopefully I'll learn what caused the file to become corrupt and resolve it for future projects.
It'd be helpful if we could figure out what is causing this file corruption.
Is there anything unique about the projects you're working in? Is the folder managed by e.g. Dropbox, Onedrive, or a similar cloud synchronization tool?