Is there a way to call a fresh template using file.edit() in R Studio after editing it without removing and reinstalling package?

I am using a template to process data in R, and I am using this per instructions from the package:

file.edit(system.file("EEM_simple_analysis.Rmd", package = "staRdom"))

I should have saved it immediately to preserve the original template, but I did not and then made edits, accidentally deleting some important lines of code. Now, when I open a new R script and try to call the original template, it consistently brings up the version with my edits. The only way I’ve been able to get around this is removing and reinstalling the package.

I have tried opening new R scripts, but each time I use the command it is still my version. I have attempted to Google this question and look through Stack Overflow, but I cannot seem to find anyone with a similar question. Perhaps I am not typing in the correct key words.

Apologies if there is an obvious answer; this is my first time using R.

Read more here: Source link