Created
November 18, 2019 21:09
-
-
Save lolek24/3ec99a3a8b661d2b6b377ab27a68e541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(urltools) | |
library(fs) | |
library(dplyr) | |
History_file <-fs::path(Sys.getenv("USERPROFILE"), | |
"AppData/Local/Google/Chrome/User Data/Default/History") | |
History_file | |
Database_file <- dplyr::src_sqlite(History_file) | |
df <- tbl(Database_file, 'urls') %>% collect() %>% | |
mutate(domain = urltools::domain(url)) | |
df %>% count(domain) %>%top_n(30, n) %>% | |
mutate(domain = fct_reorder(domain, n)) %>% | |
ggplot() + geom_col(aes(domain, n)) + coord_flip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment