• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版6cf0f5ce836f3c81837f40f64e319fe681625ffb (tree)
时间2023-01-28 04:07:45
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

Small modifications for the new dplyr release + possibility to exclude more than 1 country.

更改概述

差异

diff -r 35ba5390cb5c -r 6cf0f5ce836f R-codes/arima_simple3_parallel.R
--- a/R-codes/arima_simple3_parallel.R Thu Jan 26 20:09:19 2023 +0100
+++ b/R-codes/arima_simple3_parallel.R Fri Jan 27 20:07:45 2023 +0100
@@ -13,6 +13,8 @@
1313
1414 tidymodels_prefer()
1515
16+'%!in%' <- function(x,y)!('%in%'(x,y))
17+
1618
1719
1820
@@ -86,13 +88,28 @@
8688 }
8789
8890
91+## pattern_to_na <- function(df, pattern){
92+
93+## ## res <- df %>% na_if(., pattern)
94+
95+## res <- df |> (\(x) na_if(x, pattern))()
96+
97+
98+
99+## return(res)
100+
101+## }
102+
89103 pattern_to_na <- function(df, pattern){
90104
91105 ## res <- df %>% na_if(., pattern)
92106
93-res <- df |> (\(x) na_if(x, pattern))()
107+## res <- df |> (\(x) na_if(x, pattern))()
94108
95-
109+## across(where(is.character), \(x) na_if(x, "D"))
110+
111+ res <- df |>
112+ mutate(across(where(is.character), \(x) na_if(x, pattern)))
96113
97114 return(res)
98115
@@ -144,7 +161,7 @@
144161 rename("value"="obs_value",
145162 "date"="time_period") |>
146163 filter(geo %in% iso_map_eu27$iso2,
147- geo!="MT")
164+ geo %!in% c("MT", "ES"))
148165
149166 ms_list <- price_series |>
150167 pull(geo) |>