I have this method
public void RPlot(String var1, String Var2)
{
REngine.SetEnvironmentVariables();
REngine engine = REngine.GetInstance();
engine.Initialize();
String RCommand = "plot(" + var1 + "," + Var2 + ")";
engine.Evaluate(RCommand.ToString());
}
and this list
try
{
conDataBase.Open();
MySqlDataReader myReader = cmdDataBase.ExecuteReader();
while (myReader.Read())
{
//MessageBox.Show(""+myReader.GetFieldType(0));
ListViewItem item = new ListViewItem(myReader["Date"].ToString());
item.SubItems.Add(myReader["AnnualPrice"].ToString());
listView1.Items.Add(item);
}
}
Could you please tell me how to input my lists data into this method in order to produce a timeseries plot in R using C#?
I have tried this but it doesn't work.
while (myReader.Read())
{
ListViewItem item = new ListViewItem(myReader["Date"].ToString());
item.SubItems.Add(myReader["AnnualPrice"].ToString());
listView1.Items.Add(item);
RPlot(myReader["AnnualPrice"].ToString(), myReader["Date"].ToString());
}//end while
I have waste my whole day! I know I am close but I really don't know how to do it.