I'm trying to run my Rscript(.r file) in cmd with parameters, but this is not working. I want to add two numbers and display their result, so for this I'm passing two numbers in the cmd for which I want to perform addition This is my file cat1.R
library(getopt)
print("hello")
args <- commandArgs(trailingOnly = TRUE)
rnorm(n=as.numeric(args[1]), b=as.numeric(args[2]))
c = n + b
print(c)
This is the command to execute cat1.R in cmd
C:\Users\ypoint\Downloads>Rscript cat1.R 5 100
it gives my an error
'Rscript' is not recognized as an internal or external command,
operable program or batch file.
Any help on this would be much appreciated.Thanks