Christophe Genolini wrote: > Hi the list. > > I do not understand the philosophy behind numeric and integer. > - 1 is numeric (which I find surprising) > - 2 is numeric. > - 1:2 is integer. > Why is that ? > I hope I can answer your question at least partly: Numeric means "double", i.e. internally stored as a double precision floating point number. As far as I know this is the default. You can, however, force an object to be, e.g. an integer, a single prevision float or a double precision float. as.integer(12) as.single(12) as.double(12)
So far I only needed this if I wanted to call some C or Fortran code. Maybe there are other applications when you need to force the type? I hope this helps at least a bit further? Roland ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.