Revisión | a706cae975c6cffdf33bdf5f9456c6d349bd3733 (tree) |
---|---|
Tiempo | 2022-11-11 04:09:18 |
Autor | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
I now also remove the cases which are wrong in tam (all the numbers about aid are missing).
@@ -4,6 +4,7 @@ | ||
4 | 4 | library(janitor) |
5 | 5 | library(lubridate) |
6 | 6 | library(stringr) |
7 | +library(openxlsx) | |
7 | 8 | |
8 | 9 | source("/home/lorenzo/myprojects-hg/R-codes/stat_lib.R") |
9 | 10 |
@@ -166,18 +167,16 @@ | ||
166 | 167 | "granted_value_extended_eur" , |
167 | 168 | "nominal_value_extended_eur" , |
168 | 169 | "is_covid_case" |
169 | - ) | |
170 | + )|> ### remove the wrong cases | |
171 | + filter(!is.na(granted_aid_absolute_eur) | | |
172 | + !is.na(nominal_aid_absolute_eur) | | |
173 | + granted_range_eur!="0 - " | |
174 | + ) | |
170 | 175 | |
171 | 176 | |
172 | 177 | |
173 | 178 | |
174 | 179 | |
175 | -## write_dataset( | |
176 | -## df_new, | |
177 | -## format = "csv", | |
178 | -## path = "./data_output/", | |
179 | -## max_rows_per_file = 1e7 | |
180 | -## ) | |
181 | 180 | |
182 | 181 | |
183 | 182 | write_dataset( |
@@ -188,38 +187,15 @@ | ||
188 | 187 | ) |
189 | 188 | |
190 | 189 | |
191 | -## test <- df_new |> | |
192 | -## filter(granted_value_extended_eur==0) |> | |
193 | -## collect() | |
194 | - | |
195 | 190 | |
196 | -## test2 <- df_new |> | |
197 | -## filter(nominal_value_extended_eur==0) |> | |
198 | -## collect() | |
199 | - | |
200 | -## test3 <- df_new |> | |
201 | -## filter(nominal_aid_absolute_eur==0) |> | |
191 | +## cases_wrong <- df_new |> | |
192 | +## filter(is.na(granted_aid_absolute_eur), | |
193 | +## is.na(nominal_aid_absolute_eur), | |
194 | +## granted_range_eur=="0 - " | |
195 | +## ) |> | |
202 | 196 | ## collect() |
203 | 197 | |
204 | - | |
205 | -## test4 <- df_new |> | |
206 | -## filter(granted_aid_absolute_eur==0) |> | |
207 | -## collect() | |
208 | - | |
209 | - | |
210 | -## test5 <- df_new |> | |
211 | -## filter(is.na(nominal_aid_absolute_eur)) |> | |
212 | -## collect() | |
213 | - | |
214 | -## test6 <- df_new |> | |
215 | -## filter(is.na(granted_aid_absolute_eur)) |> | |
216 | -## collect() | |
217 | - | |
218 | - | |
219 | -## test7 <- df_new |> | |
220 | -## filter((nominal_aid_absolute_eur==0) & (granted_aid_absolute_eur==0)) |> | |
221 | -## collect() | |
222 | - | |
198 | +## save_excel(cases_wrong, "tam_errors.xlsx") | |
223 | 199 | |
224 | 200 | |
225 | 201 |