Re: [Rcom-l] Help for a Beginner please
Lynne, Irvine, Lynne schrieb: Dear Thomas, Thanks for the speedy reply, your help is much appreciated. What I would like to do is to set up a mechanism for dynamically displaying graphs created using R, from data held in an Oracle database. I am using VB.NET to build the application. So far, I have not made much progress, I have built a test application which attempts to use the R(D)Com Server to display a graph on a web page. I looked on the web for example code for the test, and came up with the following: Dim xconnector As STATCONNECTORSRVLib.StatConnector xconnector = New STATCONNECTORSRVLib.StatConnector xconnector.Init("R") Dim mygfx As New StatConnectorGraphicsDevice this line should be the problem. You're creating a graphics device but this device is never shown. Do not create mygfx using New but drop it on a form. Or otherwise, add mygfx to some form (or whatever). xconnector.AddGraphicsDevice("mygfx", mygfx.GetGFX()) xconnector.EvaluateNoReturn("plot(sin(1:100))") xconnector.RemoveGraphicsDevice("mygfx") xconnector.Close() The rest of the code looks fine. When I run the test, there are no errors reported but no graph displayed either. Any ideas on where I am going wrong? Hope this helps Thomas ___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at
RE: [Rcom-l] Help for a Beginner please
Hi there Lynne, Is there a specific reason why you are building this application using VB.Net or R(D)Com for that matter? I it to build an application for a client? There is a package available from CRAN called "RODBC" which allows R to directly connect to odbc data sources! You can set your oracle db as an odbc data source in windows by navigating to "Start->Settings->Control Panel->Administrative Tools->Data Sources (ODBC)" Once you have set up the odbc data connection with your oracle db you can query the database directly from R using commands like: >channel <- odbcDriverConnect("my.db") >my.df<-sqlQuery(channel,"select * from table1") There is no reason why you still cant use RODBC from within VB.NET. Once the data is available in R then you can output plots in anyway you please, using such devices as jpeg or "png" ( png is the preferred method for web pages). However, I would like to suggest a package called "animation" also available from CRAN which automatically builds a html web page animation of the graphs you have supplied! Regards, Wayne -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Erich Neuwirth Sent: 07 October 2008 16:12 To: R (D)COM and RExcel server related issues Subject: Re: [Rcom-l] Help for a Beginner please Do you really want to create a graphics device, or would you rather have R create a bitmap graphics file which you then can include in the displayed web page. Irvine, Lynne wrote: > Dear Thomas, > Thanks for the speedy reply, your help is much appreciated. > What I would like to do is to set up a mechanism for dynamically displaying > graphs created using R, from data held in an Oracle database. I am using > VB.NET to build the application. > So far, I have not made much progress, I have built a test application which > attempts to use the R(D)Com Server to display a graph on a web page. I looked > on the web for example code for the test, and came up with the following: > > Dim xconnector As STATCONNECTORSRVLib.StatConnector > xconnector = New STATCONNECTORSRVLib.StatConnector > xconnector.Init("R") > Dim mygfx As New StatConnectorGraphicsDevice > xconnector.AddGraphicsDevice("mygfx", mygfx.GetGFX()) > xconnector.EvaluateNoReturn("plot(sin(1:100))") > xconnector.RemoveGraphicsDevice("mygfx") > xconnector.Close() > > When I run the test, there are no errors reported but no graph displayed > either. > Any ideas on where I am going wrong? > Best wishes, > Lynne > > ____ > > From: [EMAIL PROTECTED] on behalf of Thomas Baier > Sent: Mon 06/10/2008 19:37 > To: R (D)COM and RExcel server related issues > Subject: Re: [Rcom-l] Help for a Beginner please > > > > Dear Lynne, > > please elaborate on what your code should do, and what it is doing. > > Thomas > > Irvine, Lynne schrieb: >> I think R is great and I would really like to use it generate graphics from >> my VB.NET application, but I am having a really hard time trying to get it >> work. It appears to run ok, but I can't generate any plots at all, either >> directly to the web page or to a plot file. Looking through the list it >> appears that others have trodden this path before me, so I am hoping that >> someone can help me get on the right track. >> >> I am using Microsoft Visual Studio .NET 2003, R V 2.6.1 and R(D)COM Server >> V1.35. >> >> The test code I am using is: >> Dim xconnector As STATCONNECTORSRVLib.StatConnector >> xconnector = New STATCONNECTORSRVLib.StatConnector >> xconnector.Init("R") >> Dim StatConnectorGraphicsDevice1 As New StatConnectorGraphicsDevice >> Dim mygfx As StatConnectorGraphicsDevice >> mygfx = StatConnectorGraphicsDevice1 >> xconnector.AddGraphicsDevice("mygfx", >> StatConnectorGraphicsDevice1.GetGFX()) >> xconnector.EvaluateNoReturn("plot(sin(1:100))") >> xconnector.RemoveGraphicsDevice("gfx") >> xconnector.EvaluateNoReturn("Finish") >> xconnector.Close() >> >> With initial Imports statements: >> >> Imports STATCONNECTORCLNTLib >> Imports STATCONNECTORSRVLib >> Imports StatConnControls.GraphicsDeviceClass >> >> The Build is ok and everything appears to execute ok, but no plot. Any ideas >> please? >> >> >> >> >> >> __
Re: [Rcom-l] Help for a Beginner please
Do you really want to create a graphics device, or would you rather have R create a bitmap graphics file which you then can include in the displayed web page. Irvine, Lynne wrote: > Dear Thomas, > Thanks for the speedy reply, your help is much appreciated. > What I would like to do is to set up a mechanism for dynamically displaying > graphs created using R, from data held in an Oracle database. I am using > VB.NET to build the application. > So far, I have not made much progress, I have built a test application which > attempts to use the R(D)Com Server to display a graph on a web page. I looked > on the web for example code for the test, and came up with the following: > > Dim xconnector As STATCONNECTORSRVLib.StatConnector > xconnector = New STATCONNECTORSRVLib.StatConnector > xconnector.Init("R") > Dim mygfx As New StatConnectorGraphicsDevice > xconnector.AddGraphicsDevice("mygfx", mygfx.GetGFX()) > xconnector.EvaluateNoReturn("plot(sin(1:100))") > xconnector.RemoveGraphicsDevice("mygfx") > xconnector.Close() > > When I run the test, there are no errors reported but no graph displayed > either. > Any ideas on where I am going wrong? > Best wishes, > Lynne > > > > From: [EMAIL PROTECTED] on behalf of Thomas Baier > Sent: Mon 06/10/2008 19:37 > To: R (D)COM and RExcel server related issues > Subject: Re: [Rcom-l] Help for a Beginner please > > > > Dear Lynne, > > please elaborate on what your code should do, and what it is doing. > > Thomas > > Irvine, Lynne schrieb: >> I think R is great and I would really like to use it generate graphics from >> my VB.NET application, but I am having a really hard time trying to get it >> work. It appears to run ok, but I can't generate any plots at all, either >> directly to the web page or to a plot file. Looking through the list it >> appears that others have trodden this path before me, so I am hoping that >> someone can help me get on the right track. >> >> I am using Microsoft Visual Studio .NET 2003, R V 2.6.1 and R(D)COM Server >> V1.35. >> >> The test code I am using is: >> Dim xconnector As STATCONNECTORSRVLib.StatConnector >> xconnector = New STATCONNECTORSRVLib.StatConnector >> xconnector.Init("R") >> Dim StatConnectorGraphicsDevice1 As New StatConnectorGraphicsDevice >> Dim mygfx As StatConnectorGraphicsDevice >> mygfx = StatConnectorGraphicsDevice1 >> xconnector.AddGraphicsDevice("mygfx", >> StatConnectorGraphicsDevice1.GetGFX()) >> xconnector.EvaluateNoReturn("plot(sin(1:100))") >> xconnector.RemoveGraphicsDevice("gfx") >> xconnector.EvaluateNoReturn("Finish") >> xconnector.Close() >> >> With initial Imports statements: >> >> Imports STATCONNECTORCLNTLib >> Imports STATCONNECTORSRVLib >> Imports StatConnControls.GraphicsDeviceClass >> >> The Build is ok and everything appears to execute ok, but no plot. Any ideas >> please? >> >> >> >> >> >> ___ >> Rcom-l mailing list >> Rcom-l@mailman.csd.univie.ac.at >> http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l >> More information (including a Wiki) at http://rcom.univie.ac.at >> <http://rcom.univie.ac.at/> > > > ___ > Rcom-l mailing list > Rcom-l@mailman.csd.univie.ac.at > http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l > More information (including a Wiki) at http://rcom.univie.ac.at > <http://rcom.univie.ac.at/> > > > > > > > ___ > Rcom-l mailing list > Rcom-l@mailman.csd.univie.ac.at > http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l > More information (including a Wiki) at http://rcom.univie.ac.at > > > > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.173 / Virus Database: 270.7.6/1712 - Release Date: 10/7/2008 > 9:41 AM > -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 ___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at
RE: [Rcom-l] Help for a Beginner please
Dear Thomas, Thanks for the speedy reply, your help is much appreciated. What I would like to do is to set up a mechanism for dynamically displaying graphs created using R, from data held in an Oracle database. I am using VB.NET to build the application. So far, I have not made much progress, I have built a test application which attempts to use the R(D)Com Server to display a graph on a web page. I looked on the web for example code for the test, and came up with the following: Dim xconnector As STATCONNECTORSRVLib.StatConnector xconnector = New STATCONNECTORSRVLib.StatConnector xconnector.Init("R") Dim mygfx As New StatConnectorGraphicsDevice xconnector.AddGraphicsDevice("mygfx", mygfx.GetGFX()) xconnector.EvaluateNoReturn("plot(sin(1:100))") xconnector.RemoveGraphicsDevice("mygfx") xconnector.Close() When I run the test, there are no errors reported but no graph displayed either. Any ideas on where I am going wrong? Best wishes, Lynne From: [EMAIL PROTECTED] on behalf of Thomas Baier Sent: Mon 06/10/2008 19:37 To: R (D)COM and RExcel server related issues Subject: Re: [Rcom-l] Help for a Beginner please Dear Lynne, please elaborate on what your code should do, and what it is doing. Thomas Irvine, Lynne schrieb: > I think R is great and I would really like to use it generate graphics from > my VB.NET application, but I am having a really hard time trying to get it > work. It appears to run ok, but I can't generate any plots at all, either > directly to the web page or to a plot file. Looking through the list it > appears that others have trodden this path before me, so I am hoping that > someone can help me get on the right track. > > I am using Microsoft Visual Studio .NET 2003, R V 2.6.1 and R(D)COM Server > V1.35. > > The test code I am using is: > Dim xconnector As STATCONNECTORSRVLib.StatConnector > xconnector = New STATCONNECTORSRVLib.StatConnector > xconnector.Init("R") > Dim StatConnectorGraphicsDevice1 As New StatConnectorGraphicsDevice > Dim mygfx As StatConnectorGraphicsDevice > mygfx = StatConnectorGraphicsDevice1 > xconnector.AddGraphicsDevice("mygfx", > StatConnectorGraphicsDevice1.GetGFX()) > xconnector.EvaluateNoReturn("plot(sin(1:100))") > xconnector.RemoveGraphicsDevice("gfx") > xconnector.EvaluateNoReturn("Finish") > xconnector.Close() > > With initial Imports statements: > > Imports STATCONNECTORCLNTLib > Imports STATCONNECTORSRVLib > Imports StatConnControls.GraphicsDeviceClass > > The Build is ok and everything appears to execute ok, but no plot. Any ideas > please? > > > > > > ___ > Rcom-l mailing list > Rcom-l@mailman.csd.univie.ac.at > http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l > More information (including a Wiki) at http://rcom.univie.ac.at > <http://rcom.univie.ac.at/> ___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at <http://rcom.univie.ac.at/> <>___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at
Re: [Rcom-l] Help for a Beginner please
Dear Lynne, please elaborate on what your code should do, and what it is doing. Thomas Irvine, Lynne schrieb: I think R is great and I would really like to use it generate graphics from my VB.NET application, but I am having a really hard time trying to get it work. It appears to run ok, but I can't generate any plots at all, either directly to the web page or to a plot file. Looking through the list it appears that others have trodden this path before me, so I am hoping that someone can help me get on the right track. I am using Microsoft Visual Studio .NET 2003, R V 2.6.1 and R(D)COM Server V1.35. The test code I am using is: Dim xconnector As STATCONNECTORSRVLib.StatConnector xconnector = New STATCONNECTORSRVLib.StatConnector xconnector.Init("R") Dim StatConnectorGraphicsDevice1 As New StatConnectorGraphicsDevice Dim mygfx As StatConnectorGraphicsDevice mygfx = StatConnectorGraphicsDevice1 xconnector.AddGraphicsDevice("mygfx", StatConnectorGraphicsDevice1.GetGFX()) xconnector.EvaluateNoReturn("plot(sin(1:100))") xconnector.RemoveGraphicsDevice("gfx") xconnector.EvaluateNoReturn("Finish") xconnector.Close() With initial Imports statements: Imports STATCONNECTORCLNTLib Imports STATCONNECTORSRVLib Imports StatConnControls.GraphicsDeviceClass The Build is ok and everything appears to execute ok, but no plot. Any ideas please? ___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at ___ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at