[R] haerdle package

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 14 18:51:38 CEST 2001

```On Thu, 14 Jun 2001, Paul Stansell wrote:

>
> Hi,
>
> Can anyone tell me what's wrong with the function below (I'm new to R)
>
>
>   generator <- function(n, seed)
>   {
>   .Random.seed <<- seed
>   data.1 <- rnorm(n)-1
>   data.2 <- rnorm(n)+2
>   data.3 <- runif(n) <= 0.6
>   data <- data.1*data.3 + data.2*(1-data.3)
>   data
>   }
>   seed <- c(61,40,6,40,55,2,44,30,20,56,41,1)
>   dat.mixed <- sort(generator(100,seed))
> Error in rnorm(n) : .Random.seed[1] is NOT a valid RNG kind (code)
>   rm(generator)

Because that's not how seeds are done in R.  R != S.  Try ?random and
see for yourself.

> This function is called dat.mixed.R and is from the R package called
> haerdle_1.0-1.tar.gz and contains functions from Wolfgang Haerdle's book
> called "Smoothing Techniques with Implementation in S", Springer-Verlag,
> 1991.
>
> Also, why is this package not listed in the CRAN.
> I got haerdle_1.0-1.tar.gz from
> ftp://ftp-stat.uni-klu.ac.at/pub/R/contrib and it installed okay
> (after I had removed the Makefile in haerdle/src/).

Because that is not a CRAN site.  As the original submitter of that
package to statlib, I did not port it to R as there are much better

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```