Availability of R in Sage 8.x Windows version?

59 views
Skip to first unread message

dhou...@goshen.edu

unread,
May 15, 2018, 7:53:04 AM5/15/18
to sage-support

I installed Sage 8.1 with the Windows binary:


'SageMath version 8.1, Release Date: 2017-12-07'

In a new Sage notebook, I executed the following commands:


data = [2, 3, 7, 8, 10, 11]
print median(data)
print r.quantile(data,.5)
r.boxplot(data)
 

This works in SageMathCell (lines 2 and 3 returning 15/2 and 7.5 and line 4 returning an object that includes a displayed boxplot); however, in Sage 8.1 Notebook on my Windows 7 machine (Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz 2.30 GHz, 64-bit Operating System), line 4 returns


[1] 2


and the command


r.png()
 

returns the following Python traceback:


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-3-5d43610b342f> in <module>()
----> 1 r.png()

/opt/sagemath-8.1/local/lib/python2.7/site-packages/sage/interfaces/r.py in png(self, *args, **kwds)
    445         t = r.eval('capabilities("aqua")')
    446         if "TRUE" not in s+t:
--> 447             raise RuntimeError("R was not compiled with PNG support")
    448 
    449         from sage.server.support import EMBEDDED_MODE

RuntimeError: R was not compiled with PNG support


When I google searched on various words, I kept coming upon information from about 6-8 years ago dealing with different headers in the compile phase and the presence or absence of an X11 server. Do I really need to install an X11 server, download the SageMath source, make a variety of compiler choices, and compile myself?


I also tried the above on my office Windows computer with Sage 8.2 and obtained the same result.  When I tried installing Sage 8.2 on my home computer, Windows responds that SageMath-8.2.exe is not a valid Win32 application.  When I tried the above code in CoCalc, it appears that R is not a recognized object:


Error in lines 3-3 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1043, in execute exec compile(block+'\n', '', 'single', flags=compile_flags) in namespace, locals File "", line 1, in <module> AttributeError: 'function' object has no attribute 'quantile'

Dima Pasechnik

unread,
May 15, 2018, 11:11:51 AM5/15/18
to sage-support


On Tuesday, May 15, 2018 at 12:53:04 PM UTC+1, dhou...@goshen.edu wrote:

I installed Sage 8.1 with the Windows binary:


'SageMath version 8.1, Release Date: 2017-12-07'

In a new Sage notebook, I executed the following commands:


data = [2, 3, 7, 8, 10, 11]
print median(data)
print r.quantile(data,.5)
r.boxplot(data)
 

This works in SageMathCell (lines 2 and 3 returning 15/2 and 7.5 and line 4 returning an object that includes a displayed boxplot); however, in Sage 8.1 Notebook on my Windows 7 machine (Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz 2.30 GHz, 64-bit Operating System), line 4 returns


[1] 2


and the command


r.png()
 

returns the following Python traceback:


This is not a particular issue of your installation, I see the same on Linux with Sage 8.2, if I run outside of X11.
So this is an R "feature". They actually need fonts, and they get it from X11 on Linux.
(I presume on cygwin as well)

This is with the same setup, running R (so you see, no png, no X11)

> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua 
      FALSE       FALSE       FALSE       FALSE       FALSE       FALSE 
   http/ftp     sockets      libxml        fifo      cledit       iconv 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
        NLS     profmem       cairo         ICU long.double     libcurl 
       TRUE       FALSE       FALSE       FALSE        TRUE        TRUE 

slelievre

unread,
Jun 5, 2018, 4:02:48 PM6/5/18
to sage-support
Tue 2018-05-15 11:53:04 UTC, dhou...:

>
> I installed Sage 8.1 with the Windows binary:
>
> 'SageMath version 8.1, Release Date: 2017-12-07'
>
> In a new Sage notebook, I executed the following commands:
>
> data = [2, 3, 7, 8, 10, 11]
> print median(data)
> print r.quantile(data,.5)
> r.boxplot(data)
>
Reply all
Reply to author
Forward
0 new messages