Closed
Description
after some changes, I think we can separate the steps here into four subtitles. This will increase the possibility to show extra info within each step.
- connect with the database
show in a callout that this may look in real-life
# in real-life
db_con <- DBI::dbConnect(
RSQLite::SQLite(),
host = "database.epiversetrace.com",
user = "juanito",
password = epiversetrace::askForPassword("Database password")
)
- write a local data frame as a table in the database
...
- read data from table
library(dbplyr)
# Take a reference of one table from the database
mydb <- tbl(src = db_con, "cases")
# Show the SQL queries translated
mydb %>%
dplyr::filter(confirm > 50) %>%
dplyr::arrange(desc(confirm)) %>%
dplyr::show_query()
# Pull all data down to a local tibble
mydb %>%
dplyr::filter(confirm > 50) %>%
dplyr::arrange(desc(confirm)) %>%
dplyr::collect()
- close database connection
...
Originally posted by @avallecam in #70 (comment)
Metadata
Metadata
Assignees
Type
Projects
Status
Done