Revision | 24efd1ee1761ba99adacca24ceae40fae0771fb0 (tree) |
---|---|
Time | 2022-06-23 23:51:42 |
Author | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
Some updates after the new data release by our IT.
@@ -33,11 +33,12 @@ | ||
33 | 33 | |
34 | 34 | if (xlsx==0){ |
35 | 35 | |
36 | -df_ini <- read_all_csv_to_char(pattern="(All).*\\.csv") | |
36 | +df_ini <- read_all_tsv_to_char(pattern="(All).*\\.csv") | |
37 | 37 | |
38 | 38 | |
39 | 39 | df <- df_ini %>% |
40 | 40 | clean_names() %>% |
41 | + mutate(across(contains("date"), ~select_left_pattern(.x," "))) %>% | |
41 | 42 | |
42 | 43 | distinct(aid_award_reference, .keep_all=T) %>% |
43 | 44 |
@@ -47,7 +48,7 @@ | ||
47 | 48 | ## mutate(year=year(year)) %>% |
48 | 49 | clean_data() %>% |
49 | 50 | mutate(across(contains("aid_absolute_eur"), ~as.numeric(.x))) %>% |
50 | - mutate(across(contains("date"), ~mdy(.x))) %>% | |
51 | + mutate(across(contains("date"), ~ymd(.x))) %>% | |
51 | 52 | mutate(year=year(aid_award_granted_date)) %>% |
52 | 53 | mutate(lower_bound=str_extract_before(granted_range_eur,"-")) %>% |
53 | 54 | mutate(upper_bound=str_extract_after(granted_range_eur,"-")) %>% |