Re: [Rcpp-devel] Missing values

2012-11-16 Thread Hadley Wickham
>> I guess we could come up with a nicer syntax for these, maybe static >> functions in Vector<> so that we could do : >> >> IntegerVector::is_na( ) >> NumericVector::get_na( ) >> ... > > > commmited in rev 3979. I don't want to flog a dead horse, but one of the things I like about github is how e

Re: [Rcpp-devel] Missing values

2012-11-16 Thread Romain Francois
Le 16/11/12 14:00, Hadley Wickham a écrit : On Fri, Nov 16, 2012 at 2:25 AM, Romain Francois wrote: Thanks for exploring these issue. This looks very useful. I get: str( first_log(NA) ) logi TRUE str( first_int(NA_integer_) ) int NA str( first_num(NA_real_) ) num NA str( first_ch

Re: [Rcpp-devel] Missing values

2012-11-16 Thread Hadley Wickham
On Fri, Nov 16, 2012 at 2:25 AM, Romain Francois wrote: > Thanks for exploring these issue. This looks very useful. > > I get: > >> str( first_log(NA) ) > logi TRUE >> str( first_int(NA_integer_) ) > int NA >> str( first_num(NA_real_) ) > num NA >> str( first_char(NA_character_) ) > chr "NA" >

Re: [Rcpp-devel] Missing values

2012-11-16 Thread Romain Francois
Thanks for exploring these issue. This looks very useful. I get: > str( first_log(NA) ) logi TRUE > str( first_int(NA_integer_) ) int NA > str( first_num(NA_real_) ) num NA > str( first_char(NA_character_) ) chr "NA" For first_log: a bool can either be true or false. In R logical vectors

[Rcpp-devel] Missing values

2012-11-15 Thread Hadley Wickham
Hi all, I'm working on a description of how missing values work in Rcpp (expanding on FAQ 3.4). I'd really appreciate any comments, corrections or suggestions on the text below. Thanks! Hadley # Missing values If you're working with missing values, you need to know two things: * what happen