What is the significant difference in between double-precision data kind and numeric data type in R programming?



From stat.ethz.ch:

It is a historic anomaly the R has two names for its floating-point vectors, double and numeric (and previously had real). Double is the surname of the type. Numeric is the name of the mode and also of the implicitly class. As an S4 officially class, usage "numeric". The potential confusion is the R has used setting "numeric" to typical ‘double or integer’

We deserve to think the doubles together belonging come numeric. To view this:

> is.double(1) <1> TRUE > is.numeric(1) <1> TRUER typically stores numbers together doubles. Making use of "numeric()" is the same as "double()." girlfriend can also store a number as a single or one integer. Both will certainly be numeric. Girlfriend may choose to pressure a number it is in stored as an creature for performance reasons, yet unless you are structure a parcel the trade offs could not be worth your time.

I indicate reading Gillespie"s outline for an ext info on form and performance.

You are watching: What is a double in r

edited Apr 15 "19 at 5:57

44.4k1010 gold badges101101 silver- badges171171 bronze badges
answered may 9 "18 at 14:47

76788 silver- badges1515 bronze badges
include a comment |
tk3: numeric is NOT always identical to twin (and real).

> x storage.mode(x)<1> "double"> is.numeric(x)<1> TRUE> x storage.mode(x)<1> "integer"> is.numeric(x)<1> TRUE
reply Oct 4 "19 at 14:56


3344 bronze badges
add a comment |

your Answer

many thanks for contributing solution to stack Overflow!

Please be certain to answer the question. Carry out details and share your research!

But avoid

Asking for help, clarification, or responding to various other answers.Making statements based on opinion; earlier them increase with referrals or an individual experience.

To learn more, check out our advice on writing an excellent answers.

See more: What Report Shows Which Types Of Mobile Devices Visited A Website?

Draft saved
Draft discarded

Sign up or log in

authorize up utilizing Google
sign up making use of Facebook
sign up using Email and also Password

Post together a guest

email Required, but never shown

Post together a guest


Required, but never shown

short article Your prize Discard

By click “Post her Answer”, friend agree to our terms of service, privacy policy and also cookie plan

Not the price you're feather for? Browse other questions tagged r precision or asking your very own question.

The Overflow Blog
Featured ~ above Meta
Does R treat number as double internally?
What's the difference in between a solitary precision and dual precision floating point operation?
The difference between bracket < > and twin bracket << >> because that accessing the facets of a list or dataframe
exactly how to sign up with (merge) data frames (inner, outer, left, right)
What are the differences in between "=" and also "
exactly how to transform a data structure column to numeric type?
just how do I translate precision and also scale of a number in a database?
What is the difference between float and also double?
What is the difference in between require() and library()?
just how to make a good R reproducible example
hot Network concerns an ext hot questions

concern feed
subscribe to RSS
question feed To subscribe to this RSS feed, copy and also paste this URL right into your RSS reader.

ridge Overflow
ridge Exchange Network
site design / logo design © 2022 stack Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.12.22.41046

Stack Overflow works ideal with JavaScript enabled

her privacy

By click “Accept every cookies”, you agree ridge Exchange have the right to store cookie on your an equipment and disclose info in accordance v our Cookie Policy.