What is the type of df[i] ? i.e. what does it says: SEXP tmp = df[i] ; Rprintf( "TYPEOF(tmp)=%d", TYPEOF(tmp) ) ; If this is anything but REALSXP (i.e. 14), then you have to coerce the data to bne able to use it as a NumericVector. Romain Le 30/04/13 17:19, Pratibha Rana a ?crit :
Hi,
MY application is performing really slow due to unnecessary calls to
coerceToReal from this line NumericVector ocol = df[j]. Here is a sample
of what I am doing. Is there a way to avoid the unnecessary overhead?
Please note that the data in df is float data.
void writeDataToPartitionWriter(DataFrame df, Writer
&res_writer)
{
NumericVector ocol = df[j];
if(ocol[i] ==NA_REAL)
res_writer.setFloat(j, vfloat_null);
else
{
vfloat floatout = static_cast<vfloat>(ocol[i]);
res_writer.setFloat(j, floatout);
}
}
Thanks
Pratibha
Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog: http://blog.r-enthusiasts.com |- http://bit.ly/Zs97qg : highlight 0.4.1 `- http://bit.ly/10X94UM : Mobile version of the graph gallery