Hi,You may want to spend more time with an introduction to Python: being comfortable with Python programming is a requirement to use rpy (and rpy2). Then, the documentation for rpy and rpy2 is reasonably complete (at least it answers your question).
In the meantime, I think that the dollar sign is only accepted within string delimiters (' or "", or """, or '''') in Python.
The following should get you what you wish should:
with rpy: tmp['mids']
with rpy2: tmp.rx2('mids')
L.
On 2012-05-23 19:27, Shyam Saladi wrote:
Hi,I am creating a histogram and would like to center the labels. I normally do this in R by the following:# x has my data set tmp <- hist(x, breaks=0:(max(x)+1), xaxt="n", right=FALSE, freq=FALSE) axis(1, at=tmp$mids, labels=0:max(x))In python, tmp$mids gives an error presumably because the compiler doesn't know how to interpret it. How can I specify it correctly, say in the following commands?# lengthsR has my data settmp = r.hist(lengthsR, breaks = xvals, main = infile, xlab = "deltaG", labels = r.T, xaxt='n') #, probability = r.Tr.axis(1, at=tmp$mids, xvals) Thanks a lot in advance, Shyam -- Lab of William Clemons California Institute of Technology ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ rpy-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rpy-list
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ rpy-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rpy-list
