Revision: 736
http://rpy.svn.sourceforge.net/rpy/?rev=736&view=rev
Author: lgautier
Date: 2009-02-21 08:00:20 + (Sat, 21 Feb 2009)
Log Message:
---
typo edited
Modified Paths:
--
trunk/htdocs/rpy2.data
Modified: trunk/htdocs/rpy2.data
=
Sancar Adali wrote:
> I'm trying to access and update a particular element of a matrix to update it
>
> for example in R,
>
> mat=matrix(0,nrow=2,ncol=2)
> mat[0,0]= mat[0,0]+1
In R, vector indexing starts at one; zero are silently ignored.
> How do I do this in rpy2
> do I have to use the low-
If I modify the code in the following way
m = ro.r['matrix'](range(4), nrow=2, ncol=2)
idx = ro.IntVector([1,4])
m2 = m.assign(idx, 33)
print(m2)
I get the following matrix
[,1] [,2]
[1,] 33 2
[2,] 133
I think the indices are like vector indices here, a single index, In