Hi rpy users!
I'm trying to export some variables to R environment through rpy, arrays
containing np.nan.
I want omit these values inside R, but I get an error doing this.
import numpy as np
from rpy import r
a = np.array([1,2,3,4,5,np.nan, 7, 8, np.nan, 9,10])
r.assign("a",a)
r('b <- na.omit(a)')
RPy_RException: Error in object[-omit, , drop = FALSE] : incorrect number
of dimensions
I have tryed this too, but without success.
r('c<- b[!complete.cases(b),]')
RPy_RException: Error in a[!complete.cases(a), ] : incorrect number of
dimensions
I experimented the na.rm=TRUE, inside a mean function and it's ok, but I'm
dealing with some functions that doesn't permit use "na.rm=TRUE"
r('mean(a,na.rm=TRUE)')
5.444444444444445
I apreciate any tips or helps with this.
Thank you.
All the best,
Arnaldo.
---
*Arnaldo D'Amaral Pereira Granja Russo*
Lab. de Estudos dos Oceanos e Clima
Instituto de Oceanografia - FURG
rpy
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list