Ticket #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: | 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
Change History
Changed 5 years ago by SimonKing
-
attachment
RElementAccess.patch
added
Note: See
TracTickets for help on using
tickets.

Patch relative to 3.1.alpha0