Ask Your Question

Kristen Barth's profile - activity

2023-12-24 07:09:33 +0200 received badge  Famous Question (source)
2022-07-07 14:56:13 +0200 received badge  Notable Question (source)
2022-07-07 14:56:13 +0200 received badge  Popular Question (source)
2017-12-09 21:20:04 +0200 commented answer r.xyz isn't working anymore? (R Project)

Thank you!

2017-12-09 21:19:22 +0200 received badge  Scholar (source)
2017-12-09 16:25:58 +0200 commented answer r.xyz isn't working anymore? (R Project)

Ok, when I use https://sagecell.sagemath.org/ it works perfectly fine.

2017-12-09 15:30:10 +0200 commented answer r.xyz isn't working anymore? (R Project)

... ValueError('code %r must be a string' % code) ValueError: code [10.4000000000000, 5.60000000000000, 3.10000000000000, 6.40000000000000, 21.7000000000000] must be a string

2017-12-09 15:28:10 +0200 commented answer r.xyz isn't working anymore? (R Project)

Thank you for your answer. I am using Sage via CoCalc. When I open a new Sage worksheet and type:

r

x = r([10.4,5.6,3.1,6.4,21.7]); x

I get:

<function r="" at="" 0x7fd8f6b5f5f0="">

Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2168, in r return r.jupyter_kernel(code,**kwargs) File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_jupyter.py", line 179, in run_code msg_id = kc.execute(code) File "/ext/sage/sage-8.0/local/lib/python2.7/site-packages/jupyter_client/client.py", line 244, in execute raise ...

2017-12-09 07:45:59 +0200 received badge  Student (source)
2017-12-08 21:59:37 +0200 asked a question r.xyz isn't working anymore? (R Project)

I am a beginner to Sage but I used to work with R. I know that I can create a R syntax cell by putting %r at the beginning of the cell. But there are a lot of examples which use the r.xyz syntax (for example: x = r([10.4,5.6,3.1,6.4,21.7]); x). But none of these examples work for me, what am I doing wrong?