search for: na_rm

Displaying 4 results from an estimated 4 matches for "na_rm".

2007 Mar 03
0
2 bugs in max.col() (PR#9542)
...#include <R_ext/Applic.h> /* NA handling */ #include <R_ext/Utils.h> /* probably not needed */ #define RELTOL 1e-5 void R_row_maxwithindex_double( double *x , int *nr , int *nc , int *narm , int *index , int *tiesmethod ) { int r, c, m, ntie, n_r = *nr, n_c = *nc, na_rm = *narm, ties_method = *tiesmethod; double a = 0; // to avoid uninitialized compiler warning double b, tol, small, absa; Rboolean isna; if (ties_method==1) GetRNGstate(); for (r = 0; r < n_r; r++) { /* first check row for any NAs and find the smallst entry */...
2006 Oct 12
3
multithreading calling from the rpy Python package
...cussions on "why should we make R thread-safe and how" on the website, but there appears to be no date on these documents. The R/Python wrapper functions I'm using: # a variance calculator that returns 0 for vectors that have only 1 non-NaN element: def vvar(a): v=rpy.r.var(a, na_rm=True) if isnan(v): return 0 return v # Calculate the Spearman Rho correlation between a and b and return the result # as scipy.stats.stats.spearmanr() does: R_spearmanr=rpy.r('function(a,b){ kk<-cor.test(a,b,method="spearman"); c( kk$estimate[[1]], kk$p.val...
2006 Oct 12
3
multithreading calling from the rpy Python package
...cussions on "why should we make R thread-safe and how" on the website, but there appears to be no date on these documents. The R/Python wrapper functions I'm using: # a variance calculator that returns 0 for vectors that have only 1 non-NaN element: def vvar(a): v=rpy.r.var(a, na_rm=True) if isnan(v): return 0 return v # Calculate the Spearman Rho correlation between a and b and return the result # as scipy.stats.stats.spearmanr() does: R_spearmanr=rpy.r('function(a,b){ kk<-cor.test(a,b,method="spearman"); c( kk$estimate[[1]], kk$p.val...
2006 Jul 27
6
Any interest in "merge" and "by" implementations specifically for sorted data?
Hi Developers, I am looking for another new project to help me get more up to speed on R and to learn something outside of R internals. One recent R issue I have run into is finding a fast implementations of the equivalent to the following SAS code: /* MDPC is an integer sort key made from two integer columns */ MDPC = (MD * 100000) + PCO; /* sort the dataset by the key */ PROC SORT;