Re: [Rd] C Interface

2010-06-18 Thread Dirk Eddelbuettel
Michael, You are getting confused in compiler minutia when you could be concentrating on your code. The inline package can help here. Consider the snippet below which loads inline, defines your function body sans headers etc and then uses the magic of inline to compile, link and load your fun

Re: [Rd] nchar( NA )

2010-06-18 Thread Hadley Wickham
> Value: > >     For ‘nchar’, an integer vector giving the sizes of each element, >     currently always ‘2’ for missing values (for ‘NA’). > > It may be unexpected behavior, but it's *well-documented* unexpected behavior. Oh, that must make it ok then. For a more sensible take: > library(string

Re: [Rd] C Interface

2010-06-18 Thread Simon Urbanek
On Jun 18, 2010, at 10:23 AM, michael meyer wrote: > Greetings, > > I am trying to call simple C-code from R. > I am on Windows XP with RTools installed. > > The C-function is > > #include > #include > #include > #include > > // prevent name mangling > extern "C" { > > SEXP __cdecl test

Re: [Rd] nchar( NA )

2010-06-18 Thread Romain Francois
Le 18/06/10 22:58, Sarah Goslee a écrit : Hi Romain, Did you read the help for nchar? Value: For ‘nchar’, an integer vector giving the sizes of each element, currently always ‘2’ for missing values (for ‘NA’). It may be unexpected behavior, but it's *well-documented* unexpected be

Re: [Rd] nchar( NA )

2010-06-18 Thread Henrique Dallazuanna
The help page says: "For ‘nchar’, an integer vector giving the sizes of each element, currently always ‘2’ for missing values (for ‘NA’)." On Fri, Jun 18, 2010 at 5:52 PM, Romain Francois wrote: > Hello, > > Is this expected ? > > > nchar( c( "", NA ) ) > [1] 0 2 > > Should not the

Re: [Rd] nchar( NA )

2010-06-18 Thread Sarah Goslee
Hi Romain, Did you read the help for nchar? Value: For ‘nchar’, an integer vector giving the sizes of each element, currently always ‘2’ for missing values (for ‘NA’). It may be unexpected behavior, but it's *well-documented* unexpected behavior. Sarah On Fri, Jun 18, 2010 at 4:52 P

[Rd] nchar( NA )

2010-06-18 Thread Romain Francois
Hello, Is this expected ? > nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery collage `- http:/

[Rd] C Interface

2010-06-18 Thread michael meyer
Greetings, I am trying to call simple C-code from R. I am on Windows XP with RTools installed. The C-function is #include #include #include #include // prevent name mangling extern "C" { SEXP __cdecl test(SEXP s){ SEXP result; PROTECT(result = NEW_NUMERIC(1)); double* ptr=NUMERIC_PO

Re: [Rd] CHM help does not find help docs in package stats

2010-06-18 Thread Uwe Ligges
On 17.06.2010 09:19, Thaler,Thorn,LAUSANNE,Applied Mathematics wrote: Indeed, the R version is 2.9.2. But the package was built on the very same system. Besides, another package built with the same version of R but on another machine does not show this nasty behavior. Upgrading, however, could

Re: [Rd] [R] Use of .Fortran

2010-06-18 Thread Prof Brian Ripley
On Sat, 19 Jun 2010, David Scott wrote: I have no experience with incorporating Fortran code and am probably doing something pretty stupid. Surely you saw in the posting guide that R-help is not the place for questions about C, C++, Fortran code? Diverting to R-devel. I want to use the fo