Working with nanoseconds from epoch is a breeze with nanotime, e.g.:
nanotime
> x <- 1639142792837258898 > xn <- nanotime::nanotime(x) > xn [1