I'm trying to sum a vector of doubles in a data frame. When the sum is relatively low, this works as intended.
df <- data.frame(
numbers = c(50, 632.5, 12.45)
)
sum(df$numbers)
# 694.95
But when the sum gets higher, the R begins to round the sum.
df <- data.frame(
numbers = c(50000000, 632.5, 12.45)
)
sum(df$numbers)
# 50000645
How can I stop R from eliminating these decimal points? The output I want is:
sum(df$numbers)
# 50000645.95