Pavlos Panteliadis
Pavlos Panteliadis

Reputation: 1565

Reading very small numbers in R

So I'm trying to generate some plots for my dataset, but I've encountered a certain problem with some values.

Some values are very small: 1.62132528761108e-1916 small to be exact and when it's read on R, it turns into 0.00000000000e+00

I'm reading my data like so:

df <- read.table("path/to/file", header = T, sep = ' ', numerals = "no.loss")

and even with the numerals flag set to no.loss, the number turns to 0.

How can I read the exact number?

Upvotes: 4

Views: 1133

Answers (1)

Andrey Shabalin
Andrey Shabalin

Reputation: 4614

Standard numeric data type in R (8-byte double precision) does not support such small numbers. The smallest positive number is about 1e-300

.Machine$double.xmin
# [1] 2.225074e-308

Can you convince whatever program generates your input data to save it in, say, logarithms?

Upvotes: 6

Related Questions