'create R script files, Saving as R script file and opening R script file from command line

I am using R from a distant linux server. I want to make an R script file, open an scripts files and edit them. However, I can just use the R command line. I have no idea how I can create an R script file like in RGui, or how to open such files for editing.



Solution 1:[1]

There are multiple non graphical editors to edit your file that you have access to in command line, like nano or vim.

To create an Rscript file, simply add #!/usr/bin/env Rscript at the top of your .R file and make it executable.

Also see Run R script from command line

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community