Ticket #3839 (closed defect: duplicate)

Opened 5 years ago

Last modified 5 years ago

Element access for RElement

Reported by: SimonKing Owned by: SimonKing
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: interfaces Keywords: r interface, element access
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

On  http://groups.google.com/group/sage-support/browse_thread/thread/4868d601510e9642?hl=en, Alexandr Batalshikov pointed out that

> v = c(3,5,9,1)
> v[c(2,3)]
[1] 5 9 

works in R, but the corresponding statement in Sage does not:

sage: v = r.c(3,5,9,1)
sage: n = r.c(2,3)
sage: v[n]
[1] 3

I believe this is a defect. With the attached patch, the following works:

sage: v = r.c(3,5,9,1)
sage: n = r.c(2,3)
sage: v[n]
[1] 5 9
sage: v[-2]
[1] 3 9 1
sage: v['c(2,3)']
[1] 5 9
sage: v[2,4,3]
[1] 5 1 9
sage: v[2]
[1] 5

Attachments

RElementAccess.patch Download (1.7 KB) - added by SimonKing 5 years ago.
Patch relative to 3.1.alpha0

Change History

Changed 5 years ago by SimonKing

Patch relative to 3.1.alpha0

comment:1 Changed 5 years ago by mabshoff

  • Status changed from new to closed
  • Resolution set to duplicate
  • Milestone changed from sage-3.1.1 to sage-duplicate/invalid

This is a dupe of #3838.

Cheers,

Michael

Note: See TracTickets for help on using tickets.