Explore saved categories.
parent
d000551884
commit
d092e17e33
|
@ -0,0 +1,33 @@
|
||||||
|
library(conflicted)
|
||||||
|
library(yaml)
|
||||||
|
library(RPostgreSQL)
|
||||||
|
library(tidyverse)
|
||||||
|
conflicts_prefer(dplyr::filter,
|
||||||
|
dplyr::lag)
|
||||||
|
library(magrittr)
|
||||||
|
|
||||||
|
# read the password from file
|
||||||
|
credentials <- yaml.load_file("../rapids/credentials.yaml")
|
||||||
|
pw <- credentials$PSQL_STRAW$password
|
||||||
|
|
||||||
|
#load the PostgreSQL driver
|
||||||
|
drv <- RPostgres::Postgres()
|
||||||
|
|
||||||
|
# creates a connection to the postgres database
|
||||||
|
# note that "con" will be used later in each connection to the database
|
||||||
|
con <- RPostgres::dbConnect(drv, dbname = "staw",
|
||||||
|
host = "eol.ijs.si", port = 5432,
|
||||||
|
user = "staw_db", password = pw)
|
||||||
|
|
||||||
|
rm(pw, credentials) # removes the password
|
||||||
|
|
||||||
|
# check for the bluetooth table, an example
|
||||||
|
dbExistsTable(con, "app_categories")
|
||||||
|
|
||||||
|
df_app_categories <- tbl(con, "app_categories") %>%
|
||||||
|
collect()
|
||||||
|
|
||||||
|
head(df_app_categories)
|
||||||
|
table(df_app_categories$play_store_genre)
|
||||||
|
|
||||||
|
dbDisconnect(con)
|
Loading…
Reference in New Issue