Revision | 4c42f887aceb817a8ac967dd23cf80e8a85ebe97 (tree) |
---|---|
Zeit | 2020-07-09 23:45:22 |
Autor | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
Minor modifications and correction of an error (I sort the column in a couple of pivot_wider calls).
@@ -1739,7 +1739,7 @@ | ||
1739 | 1739 | t1_plot <- t1 %>% |
1740 | 1740 | search_replace( "%", "\\\\%" ) |
1741 | 1741 | |
1742 | -nn <- linebreak(c( "Leading Sources","Rank","Outward Stocks", "Share", | |
1742 | +nn <- linebreak(c( "Leading Destinations","Rank","Outward Stocks", "Share", | |
1743 | 1743 | "Cumulative Share"), align="c") |
1744 | 1744 | |
1745 | 1745 |
@@ -3108,7 +3108,7 @@ | ||
3108 | 3108 | ) %>% |
3109 | 3109 | ## add_header_above(c("", "EU27 trade with Extra EU27" = 3, "Year-on-year growth (*)"=2)) %>% |
3110 | 3110 | footnote(general=c(## "(:) not available or not applicable.", |
3111 | - "\\\\textit{Sources}: Eurostat (bop\\\\_its\\\\_tot; bop\\\\_its6\\\\_tot; Comext)."),general_title = " ", escape = FALSE, | |
3111 | + "\\\\textit{Source}: Eurostat (Comext)."),general_title = " ", escape = FALSE, | |
3112 | 3112 | threeparttable = T) %>% |
3113 | 3113 | row_spec(pos, bold = T) |
3114 | 3114 |
@@ -3117,12 +3117,12 @@ | ||
3117 | 3117 | |
3118 | 3118 | ####Trade by MS |
3119 | 3119 | |
3120 | -df_ms_ini <- read_tsv("input_data_files/eu27_trade_ms.tsv") | |
3120 | +df_ms_ini <- read_tsv("input_data_files/eu27_trade_ms.tsv") | |
3121 | 3121 | |
3122 | 3122 | df_ms_exp <- df_ms_ini %>% |
3123 | 3123 | select(reporterlabel, year, e_value) %>% |
3124 | 3124 | mutate(e_value=e_value/1e6) %>% |
3125 | - pivot_wider(names_from=year, values_from=e_value) %>% | |
3125 | + pivot_wider(names_from=year, values_from=e_value, names_sort=T) %>% | |
3126 | 3126 | clean_names() %>% |
3127 | 3127 | arrange(reporterlabel) %>% |
3128 | 3128 | move_row(which(.$reporterlabel=="EU27"),1) |
@@ -3133,7 +3133,7 @@ | ||
3133 | 3133 | df_ms_imp <- df_ms_ini %>% |
3134 | 3134 | select(reporterlabel, year, i_value) %>% |
3135 | 3135 | mutate(i_value=i_value/1e6) %>% |
3136 | - pivot_wider(names_from=year, values_from=i_value) %>% | |
3136 | + pivot_wider(names_from=year, values_from=i_value, names_sort=T) %>% | |
3137 | 3137 | clean_names() %>% |
3138 | 3138 | arrange(reporterlabel) %>% |
3139 | 3139 | move_row(which(.$reporterlabel=="EU27"),1) |
@@ -3836,7 +3836,7 @@ | ||
3836 | 3836 | eu27_trade_concluded, |
3837 | 3837 | eu27_trade_future |
3838 | 3838 | ) %>% |
3839 | - round_all_to_n_preserve_sum(1) %>% | |
3839 | + ## round_all_to_n_preserve_sum(1) %>% | |
3840 | 3840 | format_all(1) %>% |
3841 | 3841 | mutate(across(contains("growth"), ~paste(.x,"%", sep=""))) %>% |
3842 | 3842 | mutate(across(contains("share"), ~paste(.x,"%", sep=""))) |