tag:blogger.com,1999:blog-3884463987282087684.post1228365987885374611..comments2023-12-23T20:46:11.620-08:00Comments on DataTechNotes: Running R script from C# programUnknownnoreply@blogger.comBlogger13125tag:blogger.com,1999:blog-3884463987282087684.post-69101650522427121802023-05-29T03:16:41.205-07:002023-05-29T03:16:41.205-07:00From visual studio it is working fine, however it ...From visual studio it is working fine, however it is not working when i host in IIS, i am using .net core api<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-73543390687207335262022-09-20T14:39:33.215-07:002022-09-20T14:39:33.215-07:00you are right, corrected it!you are right, corrected it!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-16316153505397296392022-09-20T02:19:28.952-07:002022-09-20T02:19:28.952-07:00I think you have a small bug in your code here. I...I think you have a small bug in your code here. It looks like you aren't calling the R script that you developed and named "gbm_test.R." I believe the following line in your code:<br /><br />var scriptpath = @"D:\repos\rsource\Script.R";<br /><br />Should have been written as:<br /><br />var scriptpath = @"D:\repos\rsource\gbm_test.R";<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-2026293131420792842019-11-30T06:51:37.484-08:002019-11-30T06:51:37.484-08:00From me it ran from the command line and in r but ...From me it ran from the command line and in r but wouldn't in c# app until i changed the Arguments parameter to Path.GetFileName(scriptpath)<br />i.e<br /> var info = new ProcessStartInfo<br /> {<br /> FileName = rpath,<br /> WorkingDirectory = Path.GetDirectoryName(scriptpath),<br /> Arguments = Path.GetFileName(scriptpath),<br /> RedirectStandardOutput = true,<br /> CreateNoWindow = true,<br /> UseShellExecute = false<br /> };dtaylor530https://www.blogger.com/profile/06076535150580266856noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-62176439889100661912019-08-26T12:43:26.462-07:002019-08-26T12:43:26.462-07:00Hi,
I tried this function with R script that write...Hi,<br />I tried this function with R script that write files.<br />The files are not created and no errors appear.<br />Any recommendations?Anonymoushttps://www.blogger.com/profile/07243955054471056570noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-74573698457350342702019-08-19T10:00:40.477-07:002019-08-19T10:00:40.477-07:00Hi!
Is there a way to get the ooutput from R Conso...Hi!<br />Is there a way to get the ooutput from R Console as it is being written? <br />thanks!Lucas Ramoshttps://www.blogger.com/profile/16615801718394346870noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-41953970261839725812019-08-06T03:05:49.253-07:002019-08-06T03:05:49.253-07:00You probably don't have gbm libraryYou probably don't have gbm libraryLuigihttps://www.blogger.com/profile/05905968972166768110noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-52666452560674522702019-07-12T07:56:47.817-07:002019-07-12T07:56:47.817-07:00Hello,
I'm trying to run this with one of my R...Hello,<br />I'm trying to run this with one of my R files but the output is blank. Do you have any ideas as to why this might be?<br />Thank you.jsschraederhttps://www.blogger.com/profile/00932955912092312429noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-74227931047865944922019-03-22T07:12:57.068-07:002019-03-22T07:12:57.068-07:00Hello, It's working perfectly now. The issue w...Hello, It's working perfectly now. The issue was related to the location of my files. the R script and the C# one have to be in the same file.Thank you so muchEvehttps://www.blogger.com/profile/13640470366785080511noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-10750445193480444222019-03-21T22:12:01.208-07:002019-03-21T22:12:01.208-07:00You are welcome!
1. Make sure your R script is wo...You are welcome! <br />1. Make sure your R script is working without error and returning the output. In example, we call the function to get the output. <br /><br /># need to call function to get the output<br />get_gbm()<br /><br />2. Make sure your rpath and rsciptpath are correct in your C# code. <br />DataTechNoteshttps://www.blogger.com/profile/08605431102919145423noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-33819471909999367852019-03-21T09:00:27.245-07:002019-03-21T09:00:27.245-07:00Hello,thanks for article, it is really helpful.
Ho...Hello,thanks for article, it is really helpful.<br />However I do not get any output in the console. Do you have any idea ?<br />Evehttps://www.blogger.com/profile/13640470366785080511noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-23257184727621415892019-02-03T21:59:07.885-08:002019-02-03T21:59:07.885-08:00You're welcome!You're welcome!DataTechNoteshttps://www.blogger.com/profile/08605431102919145423noreply@blogger.comtag:blogger.com,1999:blog-3884463987282087684.post-86377602501887353212019-02-03T07:48:09.281-08:002019-02-03T07:48:09.281-08:00Thanks for sharing. Helped me a lot.Thanks for sharing. Helped me a lot.Anonymoushttps://www.blogger.com/profile/15462009471441243939noreply@blogger.com