R Script Content Lost but File Still Shows 112KB – How to Recover?

I'm facing a serious issue with one of my R scripts and desperately need help recovering its content. Here's what happened:

  1. Problem Description
  • After force rebooting my Windows PC, one critical R script (.R file) shows blank/empty content when opened in RStudio
  • However, Windows Explorer still shows the file size as 112KB (original size)
  • The file appears intact, but content is missing when opened
  1. What I've Tried
    ✓ Attempted to reopen with different encodings (UTF-8, ANSI, etc.)
    ✓ Verified file isn't hidden or read-only
    ✓ Tried opening in Notepad++/VS Code - same empty result

I also tried updating RStudio to the latest version (2024.12.1+563) and R to version 4.5.0, but the issue still persists. Does any one can help me? Any other suggestions would be appreciated

Can you post the file (or a link to it) here?

Thank you for your prompt reply! I’ve shared the file on GitHub for download: https://github.com/williamshell/R-script/issues/1

That link produces a 404 error for me.

Can you download the "total.R" file with the following link https://github.com/williamshell/Wan-et-al-2024-16S_paper-code.

This one also gives a 404 error

1 Like