|
|
@@ -5,6 +5,20 @@ library(RSQLite) |
|
|
|
library(stringr) |
|
|
|
library(plotly) |
|
|
|
|
|
|
|
uniq <- function(df, ...) |
|
|
|
{ |
|
|
|
eval(substitute(alist(...))) %>% |
|
|
|
map_chr(as.character) %>% |
|
|
|
intersect(names(df)) %>% |
|
|
|
map(~rle(df[[.x]] %>% c) %>% |
|
|
|
.$lengths %>% |
|
|
|
cumsum) %>% |
|
|
|
reduce(union) %>% |
|
|
|
sort -> columns |
|
|
|
|
|
|
|
|
|
|
|
df[columns,] |
|
|
|
} |
|
|
|
dbConnect(SQLite(), "ecn.db") -> db |
|
|
|
|
|
|
|
# Index villes et spés ---- |
|
|
|