Friday, 15 March 2019

How to run R script on Codec server(private server) through command line

Please make sure that the R scipt file that you want to execute are transferred to codec server using WinSCP. The input file that the script operates on and the script itself should be on the root server path for your ease. This way, you can specify the file name directly in the script and there will be no need to specify the full path.

On codec server, you have to use putty to login and once logged in, you have to make sure the packages are installed for your code.

1) write R and press enter
2) write install.packages('yourpackagename')
3) q()
Now you are back to normal command line.

You can open the script file on server and change the paths to ones on codec server. e.g. library("tictoc", lib.loc="~/R/x86_64-pc-linux-gnu-library/3.5")

Suppose the name of your script file is a.R

4) Write the following command: Rscript a.R

Your R script will start executing.


No comments:

Post a Comment

what is a good PhD contribution?

When PhD candidates embark on their thesis journey, the first thing they will likely learn is that their research must be a “significant ori...