0

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.

Litisqe Kumar
  • 2,512
  • 4
  • 26
  • 40
  • It would probably help if you provided the actual error you're getting. "It doesn't work" is very vague, and it makes it difficult for people to help. – Carlos Rodriguez Jul 13 '15 at 03:48
  • Hi Litisqe Kumar thanks for your response. I am trying to populate the public void RPlot(String var1, String Var2) method in order to produce a diagram. The error that have is that "Could not retrieve a pointer for the symbol 'R_ParseErrorMsg' in the file 'R.dll'" –  Jul 13 '15 at 12:03

0 Answers0