library(dplyr)
Things that fail without immediate warning
My favorite loop pattern leads to bogus numbers:
for (i in bit64::as.integer64(1:3)) print(i)
sapply, lapply, mapply, etc. lead to bogus numbers:
sapply(bit64::as.integer64(1:3), print)
Should use purrr::map instead:
purrr::map(bit64::as.integer64(1:3), print)
as.numeric(1) %in% bit64::as.integer64(1:3) as.integer(1) %in% bit64::as.integer64(1:3) bit64::as.integer64(1) %in% as.numeric(1:3) bit64::as.integer64(1) %in% as.integer(1:3)
Converts to bogus numbers:
RJSONIO::toJSON(list(i = bit64::as.integer64(1)))
Things that throw an error, but can be avoided by explicit casting.
file <- tempfile() df <- data.frame(i = bit64::as.integer64(1)) readr::write_csv(df, file) df2 <- readr::read_csv(file, col_types = c(i = "c")) %>% mutate(i = bit64::as.integer64(.data$i)) df2
# This throws and error: bind_rows(data.frame(i = bit64::as.integer64(1)), data.frame(i = as.numeric(2)))
For this reason, the type of integer that is returned depends on the value:
df <- data.frame(key = c(1,2), value = bit64::as.integer64(c(2^2, 2^62))) andr <- Andromeda::andromeda(table = df) andr$table %>% filter(key == 1) andr$table %>% filter(key == 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.