Quantcast

returning value from source() in R .Net

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

returning value from source() in R .Net

Paul Rustomji
Hello
I would like to source an R script from within a C# .Net application equivalent to:

source("my_r_code.r")

I can get this to run but am not sure how to retrieve R objects defined with script my_r_code.r at runtime.

For example, if "my_r_code.r" contains

#-- contents of my_r_code.r---------------------
x <- 1:10
xmean <- mean(x)
#------------------------------------------------------

My question is how to return the value of xmean to the .Net application?

Paul





        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: returning value from source() in R .Net

Jeff Newmiller
I am mystified as to why you think you can source a snippet of one interpreted language into a different compiled language.

Fortunately this is not the correct forum for your question, so I can punt. Google suggests that you look at rdotnet.codeplex.com, and perhaps read their documentation, and if that doesn't help then post your question on their discussion forum.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<[hidden email]>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

[hidden email] wrote:

>Hello
>I would like to source an R script from within a C# .Net application
>equivalent to:
>
>source("my_r_code.r")
>
>I can get this to run but am not sure how to retrieve R objects defined
>with script my_r_code.r at runtime.
>
>For example, if "my_r_code.r" contains
>
>#-- contents of my_r_code.r---------------------
>x <- 1:10
>xmean <- mean(x)
>#------------------------------------------------------
>
>My question is how to return the value of xmean to the .Net
>application?
>
>Paul
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...