I need to use Regression (Linear) in my application for that i am using R.Net.but when i am using the function lm() it’s showing an error “Error in the application.” but the same code will working in “R” is there any problem with my code or do i need to import any more packages?…
my code
private void Form1_Load(object sender, EventArgs e)
{
REngine.SetDllDirectory(@"C:\Program Files\R\R-2.13.1\bin\i386");
REngine engine = REngine.CreateInstance("RDotNet");
engine.Evaluate("WQ<-read.csv('c:\\Documents and Settings\\hardinmvarghese\\Desktop\\reg.csv')");
engine.EagerEvaluate("rst <- lm(V1 ~ V2+V3+V4+V5,WQ)");
}
if any one knows this please help me…
Do you have read/write rights on that directory from .Net? Use a try catch block and check the Exception type and Message. Maybe its not something thats wrong the the REngine code.