I am writing a little app that does linear regression on a given data set. I was hoping to use R.Net to achieve this. However, I appear to be having a little bother with the lm() function, and would appreciate it if someone could point me in the direction of a solution.
Running the following script causes an exception to be thrown by R.Net:
___Explanatory <- 1:10
Dependent <- 10 + Explanatory * 2
coefs <- lm(Dependent ~ Explanatory)$coefficients___
This script runs fine in RStudio and if I change the last line to add the two lists together then it works in R.Net as well. i.e. change ___coefs <- lm(Dependent ~ Explanatory)$coefficients___ to ___coefs <- Dependent + Explanatory___
Any assistance would be very much appreciated.
Running the following script causes an exception to be thrown by R.Net:
___Explanatory <- 1:10
Dependent <- 10 + Explanatory * 2
coefs <- lm(Dependent ~ Explanatory)$coefficients___
This script runs fine in RStudio and if I change the last line to add the two lists together then it works in R.Net as well. i.e. change ___coefs <- lm(Dependent ~ Explanatory)$coefficients___ to ___coefs <- Dependent + Explanatory___
Any assistance would be very much appreciated.