On Thu, Feb 27, 2014 at 10:11 AM, Fred Gruber <[email protected]> wrote:
> Let me explain better. I have a function in python that uses rpy to plot a
> dataframe from R in html. It does this by converting the R dataframe to a
> panda dataframe and then using html() to print a table of the dataframe.
> This function is called printRdf()
>
> Now suppose I'm in a cell with  r mode. I would like to be able to call this
> python function from the R environment. I was wondering if there was some
> sort of function similar to the way the r function works when you are in
> sage mode. For example suppose we had a function called sage so that you
> could call python functions
> %r
> a<-data.frame(x=c(1.2,3,4),y=c(4,3,3))
> sage('printRdf("a")')

There is no such functionality for any of the interface (R, etc.).
I've sometimes thought a bit about how to do this, but never actually
tried seriously.    It's a difficult problem given the generic nature
of the pexpect interfaces; with the current design, the R process has
no idea that it is being called from Sage.

 -- William

>
>
>
> On Thursday, February 27, 2014 11:53:59 AM UTC-5, Jan Groenewald wrote:
>>
>> Hi
>>
>> A cell can have %r at the top line and then execure R, or you can import
>> rpy2
>>
>> Regards,
>> Jan
>>
>>
>>
>> On 27 February 2014 18:47, Fred Gruber <[email protected]> wrote:
>>>
>>> Hello,
>>> In sage notebook working in sage mode I can execute R commands by using
>>> r('command') or r.functionname()
>>>
>>> If I'm working on the sage command is there any way to access python or
>>> sage functions in a similar way?
>>>
>>> thanks
>>> Fred
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "sage-support" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/group/sage-support.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>>
>> --
>>   .~.
>>   /V\     Jan Groenewald
>>  /( )\    www.aims.ac.za
>>  ^^-^^
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to