Re: [R] Error in FUN(newX[, i], ...) : `x' must be atomic

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 27 Jul 2005 - 19:26:40 EST

Simon Blomberg <blomsp@ozemail.com.au> writes:

> Actually, atoms are originally a Lisp concept. Objects are either atoms or
> not. Atoms are data types that cannot be taken apart, such as numbers or
> symbols. Lists and vectors (of length > 1) are examples of non-atomic data
> types. Did you pass a vector to FUN?

Actually, vectors ARE atomic in R, so your definition is somewhat off target.

> is.atomic(rnorm(5))

[1] TRUE In the extreme, the only true atom is the bit, everything else can be taken apart - doubles into (sign,exponent,mantissa) etc. So languages *define* their own atoms, as objects that are not composed of other objects in the language. (And even that is a partial lie for R, because atoms can have attributes. Atomicity is purely based on the type of an object. The help page has a list of the atomic types.)

> Cheers,
>
> Simon.
>
> At 12:22 PM 27/07/2005, Srinivas Iyyer wrote:
> >Hello Group,
> > What is the meaning of the error. is there any place
> >to look for this. I guess 'atomic' seems to be OOP
> >related concept.
> >
> >thank you
> >srini
> >
> >______________________________________________
> >R-help@stat.math.ethz.ch mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
> Simon Blomberg, B.Sc.(Hons.), Ph.D, M.App.Stat.
> Centre for Resource and Environmental Studies
> The Australian National University
> Canberra ACT 0200
> Australia
> T: +61 2 6125 7800 email: Simon.Blomberg_at_anu.edu.au
> F: +61 2 6125 0757
> CRICOS Provider # 00120C
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Jul 27 19:31:57 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:03 EST