Long Numbers As A Character String

后端 未结 6 735
栀梦
栀梦 2020-12-01 23:40

As part of my dataset, one of the columns is a series of 24-digit numbers.

Example:

bigonumber <- 429382748394831049284934

When

6条回答
  •  没有蜡笔的小新
    2020-12-01 23:58

    If you want numbers as numbers you can't print all values. The digits options allows a maximum of 22 digits. The range is from 1 to 22. It uses the print.default method. You can set it with:

    options( digits = 22 )
    

    Even with this options, the numbers will change. I ignore why that happens, most likely due to the fact that the object your are about to print (the number) is longer than the allowed amount of digits and so R does some weird stuff. I'll investigate about it.

提交回复
热议问题