0

I have the following situation: my file (mov.csv) have a column called "Id", like in the image:

Img print

The situation: When I parse the info from the file I need to maintain the length because the same "Id" is in other related tables (since this columns is the "key"), but R automatically change me column info to scientific notation!, like in the following code result:

library(readr)
library(dplyr)

mov <- read_csv("mov.csv")

mov

the result if I do not apply nothing:

not using any option

I need to use Id column with the complete set of digits (19 digits), but R do not shows that... When I search for solutions, all are related to very short "scientific numbers", but it's not the case I though (there's a lot of "solutions" saying put in the header something like that:

mov$Id <- mov$Id %>% as.numeric() %>% print(digits = 19)

but it only transform the info to another more unsefull number, since performs a kind of rounding of the number:

no solution

what can I do? please, your help!

Thanks in advance!

  • Try `read_csv("mov.csv", col_types = list(Id=col_character())`. R can't store that many digits exactly as a numeric value so you need to keep it a character. – MrFlick Jul 31 '21 at 16:42
  • I really thank you @MrFlick your suggestion.... Thanks a lot! (resolved!) – DnLusho Jul 31 '21 at 17:03

0 Answers0