Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 405ebb9

Browse files
author
Matthias Koeppe
committed
More # optional - rpy2
1 parent 4403924 commit 405ebb9

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ the examples in ``r.kruskal_test?`` in the notebook.
146146

147147
::
148148

149-
sage: x=r([2.9, 3.0, 2.5, 2.6, 3.2]) # normal subjects
150-
sage: y=r([3.8, 2.7, 4.0, 2.4]) # with obstructive airway disease
151-
sage: z=r([2.8, 3.4, 3.7, 2.2, 2.0]) # with asbestosis
152-
sage: a = r([x,y,z]) # make a long R vector of all the data
153-
sage: b = r.factor(5*[1]+4*[2]+5*[3]) # create something for R to tell which subjects are which
154-
sage: a; b # show them
149+
sage: x=r([2.9, 3.0, 2.5, 2.6, 3.2]) # normal subjects # optional - rpy2
150+
sage: y=r([3.8, 2.7, 4.0, 2.4]) # with obstructive airway disease # optional - rpy2
151+
sage: z=r([2.8, 3.4, 3.7, 2.2, 2.0]) # with asbestosis # optional - rpy2
152+
sage: a = r([x,y,z]) # make a long R vector of all the data # optional - rpy2
153+
sage: b = r.factor(5*[1]+4*[2]+5*[3]) # create something for R to tell # optional - rpy2
154+
....: # which subjects are which
155+
sage: a; b # show them # optional - rpy2
155156
[1] 2.9 3.0 2.5 2.6 3.2 3.8 2.7 4.0 2.4 2.8 3.4 3.7 2.2 2.0
156157
[1] 1 1 1 1 1 2 2 2 2 3 3 3 3 3
157158
Levels: 1 2 3
@@ -160,7 +161,7 @@ the examples in ``r.kruskal_test?`` in the notebook.
160161
161162
::
162163

163-
sage: r.kruskal_test(a,b) # do the KW test!
164+
sage: r.kruskal_test(a,b) # do the KW test! # optional - rpy2
164165
Kruskal-Wallis rank sum test
165166

166167
data: sage17 and sage33
@@ -178,7 +179,7 @@ Notice that R also uses the ``#`` symbol to indicate comments.
178179
179180
::
180181

181-
sage: %r
182+
sage: %r # optional - rpy2
182183
....: x = c(18,23,25,35,65,54,34,56,72,19,23,42,18,39,37) # ages of individuals
183184
....: y = c(202,186,187,180,156,169,174,172,153,199,193,174,198,183,178) # maximum heart rate of each one
184185
....: png() # turn on plotting

src/sage/interfaces/interface.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,9 @@ def __reduce__(self):
798798
"abc"
799799
sage: loads(dumps(pari([1,2,3])))
800800
[1, 2, 3]
801-
sage: loads(dumps(r('"abc"')))
801+
sage: loads(dumps(r('"abc"'))) # optional - rpy2
802802
[1] "abc"
803-
sage: loads(dumps(r([1,2,3])))
803+
sage: loads(dumps(r([1,2,3]))) # optional - rpy2
804804
[1] 1 2 3
805805
sage: loads(dumps(maxima([1,2,3])))
806806
[1,2,3]
@@ -851,10 +851,11 @@ def _reduce(self):
851851
by the doctests because the original identifier was reused. This test makes sure
852852
that does not happen again:
853853
854-
sage: a = r("'abc'")
855-
sage: b = dumps(a)
856-
sage: r.set(a.name(), 0) # make identifier reuse doesn't accidentally lead to success
857-
sage: loads(b)
854+
sage: a = r("'abc'") # optional - rpy2
855+
sage: b = dumps(a) # optional - rpy2
856+
sage: r.set(a.name(), 0) # make sure that identifier reuse # optional - rpy2
857+
....: # does not accidentally lead to success
858+
sage: loads(b) # optional - rpy2
858859
[1] "abc"
859860
860861
"""
@@ -1376,13 +1377,13 @@ def name(self, new_name=None):
13761377
13771378
EXAMPLES::
13781379
1379-
sage: x = r([1,2,3]); x
1380+
sage: x = r([1,2,3]); x # optional - rpy2
13801381
[1] 1 2 3
1381-
sage: x.name()
1382+
sage: x.name() # optional - rpy2
13821383
'sage...'
1383-
sage: x = r([1,2,3]).name('x'); x
1384+
sage: x = r([1,2,3]).name('x'); x # optional - rpy2
13841385
[1] 1 2 3
1385-
sage: x.name()
1386+
sage: x.name() # optional - rpy2
13861387
'x'
13871388
13881389
::

src/sage/misc/sageinspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ def foo(x, a='\')"', b={not (2+1==3):'bar'}): return
14951495
The following produced a syntax error before the patch at :trac:`11913`,
14961496
see also :trac:`26906`::
14971497
1498-
sage: sage.misc.sageinspect.sage_getargspec(r.lm)
1498+
sage: sage.misc.sageinspect.sage_getargspec(r.lm) # optional - rpy2
14991499
ArgSpec(args=['self'], varargs='args', keywords='kwds', defaults=None)
15001500
15011501
The following was fixed in :trac:`16309`::

0 commit comments

Comments
 (0)