library("allofus")
# returns 2 rows, as expected
::tbl(con, "concept") %>%
dplyr::filter(concept_id %in% c(1112807, 4167538)) %>%
dplyraou_collect() %>%
::filter(concept_id %in% c(1112807, 4167538))
dplyr
<- tbl(con, "concept") %>%
default_collect ::filter(concept_id %in% c(1112807, 4167538)) %>%
dplyr::collect()
dplyr# returns 2 rows in Jupyter and 0 in RStudio
::filter(default_collect, concept_id %in% c(1112807, 4167538)) dplyr
Collect a tbl object and convert integer64 columns to double
Description
If you connect to the All of Us database via aou_connect()
, integer columns will be converted to the int64 class, which can represent 64-bit integers. This is safer than keeping as R’s default integer class, because some of the values of the ID columns in All of Us are larger than R can handle as integers. However, this can make working with the local table more difficult in RStudio as a vector of values will not match the int64 class. This is not a problem in Jupyter notebooks, meaning that code that works on one platform may not work on another. A safe practice is to use aou_collect()
, which works just like dplyr::collect()
except that any integer values are converted to doubles. If this is not what you want, set convert_int64 = FALSE
.
Usage
aou_collect(data, convert_int64 = TRUE, ...)
Arguments
data
|
A reference to a remote database table (or unexecuted query) |
convert_int64
|
Do you want to convert integer values to doubles? Defaults to TRUE
|
…
|
Other arguments passed to dplyr::collect() |
Details
Value
a local dataframe