2 of 2 people found this helpful
Great question! You can pass parameters into R scripts using a similar approach as other arguments (.arg1, for example). There's a catch though. When using parameters, after indicating the argument number, you need to add a . In the example below, [Periods] is a parameter and we call it on the script as .arg2.
jjearnts <- ts(.arg1,deltat=1/52,start=c(2008,12));
fcast <- forecast(jjearnts, h=.arg2);
append(.arg1[(.arg2+1):n],fcast$mean, after = n-.arg2)",
I haven't tested your script but something like this may work:
a <- rep(1, length(.arg1));
avg([values]), [moving_window_width], [sigma]) == 0
Hope this helps!
your solution helped me too, I was trying to pass a parameter .arg5 into k-means, I needed the  adding to the end to make it work.
result <- kmeans(data.frame(.arg1,.arg2,.arg3,.arg4),.arg5); result$cluster;