Charecter to numeric: display all decimal places in a tibble

use print.data.frame(df) as suggested in Why do tibbles and data.frames display decimal places a bit differently? - #2 by danr

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
df <- tibble(
  x_as_character = c("0.1232456789", "0.9101112131415")
) %>% 
  mutate(x_as_numeric = as.numeric(x_as_character))
options(digits=15)
print.data.frame(df)
#>    x_as_character    x_as_numeric
#> 1    0.1232456789 0.1232456789000
#> 2 0.9101112131415 0.9101112131415

Created on 2022-02-27 by the reprex package (v2.0.1)

1 Like