Wells Oliver wrote:
> I cannot for the life of me get the following code to work...
> 
> r = robjects.r
> r.library('hexbin')
> hits = {'y': [-99.400000000000006, -66.269999999999996], 'x': 
> [121.48999999999999, 34.140000000000001]}
> bin = r.hexbin(hits['x'], hits['y'], xlab='', ylab='')
> r.plot(bin, main=player['name'])
> 
> The error (on the line w/ r.plot):
> 
>   File 
> "/usr/local/lib/python2.6/dist-packages/rpy2/robjects/__init__.py", line 
> 422, in __call__
>     res = super(RFunction, self).__call__(*new_args, **new_kwargs)
> rinterface.RRuntimeError: Error in cut.default(rcnt, colorcut, labels = 
> FALSE) : 
>   invalid number of intervals
> 
> This works fine running in the actual R application-

Really ?

With R-2.9:

 > library(hexbin)
Loading required package: grid
Loading required package: lattice
 > hits = list(y=c(-99, -66), x=c(121,34))
 > bin <- hexbin(hits$x, hits$y)
 > plot(bin)
Error in cut.default(rcnt, colorcut, labels = FALSE) :
   invalid number of intervals


Otherwise, you probably want to wrap your definitions of 'x' and 'y' in 
'hits' with robjects.FloatVector().
http://rpy.sourceforge.net/rpy2/doc/html/introduction.html#creating-rpy2-vectors



> all you need to 
> pass (seemingly) to plot() is the bin itself. Any tips? Thanks.
> 
> -- 
> Wells Oliver
> we...@submute.net <mailto:we...@submute.net>
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to