I need to execute some R scripts in c# .So I write the code below including R.net package to do interaction between R and c#. It's about importing csv files.
using RDotNet;
namespace ConsoleApp11
{
class Program
{
static void Main(string[] args)
{
REngine engine = REngine.GetInstance();
DataFrame testData = engine.Evaluate("DataIns<-read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Diagnostic.csv', header=TRUE, sep = ';')").AsDataFrame();
DataFrame DataAch = engine.Evaluate("DataAch=read.table('C:/Users/isalah/Desktop/Fichiers_CRM /Fichier_csv/Achats1.csv',header=TRUE,sep = ';')").AsDataFrame();
DataFrame DataDia = engine.Evaluate("DataDia=read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Diagnostic.csv',header =TRUE,sep = ';')").AsDataFrame();
DataFrame DataCad = engine.Evaluate("DataCad=read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/CADEAUX.csv',header =TRUE,sep = ';')").AsDataFrame();
double v = new double();
v = testData.ColumnCount;
}
}
}
It seems that the program read the first file but It's stopped in the next one showing in the console this error :
Error in file(file, "rt") : cannot open the connection '
How could I solve this problem please?