2

When I execute my code c# , and I didn't call the console window using

console.writeline(...)

The program shows me in the console window data frame elements. for example here :

REngine engine = REngine.GetInstance();
DataFrame DataIns = engine.Evaluate("DataIns<-read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Diagnostic.csv', header=TRUE, sep =';',fill = TRUE)").AsDataFrame();
DataFrame DataAch = engine.Evaluate("DataAch=read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Achats1.csv',header=TRUE,sep =';',fill = TRUE)").AsDataFrame();
DataFrame DataDia = engine.Evaluate("DataDia=read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Diagnostic.csv',header=TRUE,sep =';',fill = TRUE)").AsDataFrame();
DataFrame DataCad = engine.Evaluate("DataCad=read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/CADEAUX.csv',header=TRUE,sep =';',fill = TRUE)").AsDataFrame();

It shows all the element of the data frame DataDia . As shown in the picture above : these are the end element of the data DataDia. enter image description here

even I didn't call the console window at all! Why It shows exactly elements of the data DataDia ? How can I stop that? I need just to show elements using the command console.writeline ?

Thanks!

User2018
  • 61
  • 10
  • 1
    So what is the output exactly? Where does it come from? – Patrick Hofman Jan 10 '18 at 08:18
  • @PatrickHofman, you can see the edited question – User2018 Jan 10 '18 at 08:30
  • Did you check the documentation of `REngine`? – Patrick Hofman Jan 10 '18 at 08:31
  • @PatrickHofman, no. Is that related to the REngine documentation? – User2018 Jan 10 '18 at 08:32
  • But you made a console app.. so chances are the engine has tried to make best of what you told it – BugFinder Jan 10 '18 at 08:36
  • @BugFinder, what kind of application should I chose when i want to create new project? I need just to show what I need for debugging purposes! – User2018 Jan 10 '18 at 08:39
  • could this be tracing output? maybe it is a warning or error message including a data dump? does it also occur when you run in "Release"? can you call the exe from command line with "ConsoleApp11.exe > log.txt" so we get to see everyhing? what is that with the operator "<-" in the first line vs. the operator "=" in the three lines that follow? – Cee McSharpface Jan 10 '18 at 08:48
  • @dlatikay, "<-" this is an R affectation equal at "="! there is no problem about that. Yes there is an error also generated . But I need as I say to use console window for **debugging purposes** .I didn't know how call _ConsoleApp11.exe > log.txt_ to show you all thing!! – User2018 Jan 10 '18 at 09:01
  • open a command prompt, navigate to the bin directory where consoleapp11.exe is located, type "ConsoleApp11 > log.txt". This will redirect all console output to the log.txt file in the same directory. Open it, and let's see that error message. re "<-": I was just thinking since this is the only obvious difference and you wrote the elements are from Diagnostic.csv which is mentioned twice, in first and in third command. – Cee McSharpface Jan 10 '18 at 10:31
  • @dlatikay, I thank you for your attention about **Diagnostic.csv**, it was really called twice! so I change the first one to **Inscrits.csv**.! the console application don't stop running when i just changed this : _DataFrame DataIns = engine.Evaluate("DataIns<-read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Diagnostic.csv', header=TRUE, sep =';',fill = TRUE)").AsDataFrame();_ to this : _DataFrame DataIns = engine.Evaluate("DataIns<-read.table('C:/Users/isalah/Desktop/Fichiers_CRM/Fichier_csv/Inscrits.csv', header=TRUE, sep =';',fill = TRUE)").AsDataFrame();_ ?? No txt.file! – User2018 Jan 10 '18 at 10:56
  • I see two solution paths here: 1) figure out what causes REngine to dump data, and stop it doing that - find the error and remedy. 2) temporarily redirect console output to a file, or to nirvana, while the engine.Evaluate commands run, using an approach [like this](https://stackoverflow.com/q/11911660/1132334) – Cee McSharpface Jan 10 '18 at 11:12
  • @dlatikay, thanks for your response but i didn't understand exactly how should I use the link below. there is many suggestions and I didn't understand the relationship bbetween my problem and which in the link! If you can to suggest clear ansewer not as a comment ! thanks! – User2018 Jan 10 '18 at 12:52

0 Answers0