R saving code as pdf

I'm having troubles with working with R code, because all my code is automatically saved as a pdf instead of r-code. I tried uninstalling the app but nothing changed.

Please be more specific, What software are you using (R GUI or RStudio)? What are the specific steps you follow to "save" your code? and What do you mean by r-code (this is not an actual file extension)?

I'm using RStudio. To save the code I used save as... and the only way I can save it is as "all files", but this somehow manages to save my code (to make a plot) as a pdf, which I then cannot reopen.

Hi @o.b.o,
Try this workflow to see if it fixes your problem. I assume you are using RStudio under Windows?

Open a new, empty script (code) file (via the RStudio menu or using the keyboard shortcut CTRL-SHIFT-N).
Type (or paste) some simple R commands.
Click "Save" (CTRL-s), and in the dialogue box type a suitable filename e.g. my_test_script.R
(note the use of the .R file extension (can also be .r) -- this makes sure that Windows knows to open this file with RStudio.
Close your script file.
Try re-opening it from the RStudio file menu.

Saving a script (code) file is different from saving the output from a plot(), which does have the option to save as .pdf


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.