I want to show ellipse in c#. My codes is fine when it running in R but i get message from c# like this : "Object is static; operation not allowed (Exception from HRESULT: 0x8004000B (OLE_E_STATIC))"
here this my codes :
df.rconn.Evaluate("library(cluster)")
df.rconn.Evaluate("library(rrcov)")
public void setScatter(int xAxis, int yAxis, int zAxis, List<string> variable)
{
// plot from R
//to show outlier with method : classic & robust Mve
this.comboBoxXAxis.SelectedIndex = xAxis;
this.comboBoxYAxis.SelectedIndex = yAxis;
dataform.rconn.EvaluateNoReturn("x<-X[," + xAxis + "] ");
dataform.rconn.EvaluateNoReturn("y<-X[," + yAxis + "] ");
dataform.rconn.EvaluateNoReturn("shape <- cov(X)");
dataform.rconn.EvaluateNoReturn("center<- colMeans(X)");
dataform.rconn.EvaluateNoReturn("d2.95 <- qchisq(0.95, df = 2)");
//dataform.rconn.EvaluateNoReturn("gr<- grid(lty=3,col='lightgray', equilogs = 'TRUE')");
//dataform.rconn.Evaluate("mtext('with classical (red) and robust (blue)')");
dataform.rconn.EvaluateNoReturn("plot(x,y, main='Draw Ellipse ', pch=19,col='black', type='p')");
dataform.rconn.EvaluateNoReturn("elp<- unname(ellipsoidPoints(shape, d2.95,center))");
dataform.rconn.Evaluate(" lines(elp, col='red' , lty=7 , lwd=2)");
//dataform.rconn.EvaluateNoReturn("lines(e)");
//dataform.rconn.EvaluateNoReturn("lines(ellipsoidPoints(mve@cov, d2 = d2.95, loc=mve@center), col='blue', lty='7' , lwd='2') ");
axGraphicsDevice2.RemoveFromConnector();
}
in any code that I comment always got the same error. I don't know why this problem happen. Any idea how to show that ellipse ? Thank you very much because you have helped me in completing my thesis.