Opened 13 years ago

Closed 13 years ago

#3839 closed defect (duplicate)

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: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


On, 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 (1)

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

Download all attachments as: .zip

Change History (2)

Changed 13 years ago by SimonKing

Patch relative to 3.1.alpha0

comment:1 Changed 13 years ago by mabshoff

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

This is a dupe of #3838.



Note: See TracTickets for help on using tickets.