• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revisiónd19e932160cfac21b0d1fad1e8dffcc7bf6e1db4 (tree)
Tiempo2024-01-10 23:11:50
AutorLorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I added a function to translate a number into a missing value.

Cambiar Resumen

Diferencia incremental

diff -r 83a1e693489f -r d19e932160cf R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Tue Jan 09 16:11:56 2024 +0100
+++ b/R-codes/stat_lib.R Wed Jan 10 15:11:50 2024 +0100
@@ -2906,6 +2906,20 @@
29062906
29072907 }
29082908
2909+
2910+
2911+number_to_na <- function(df, number=0){
2912+
2913+
2914+ res <- df |>
2915+ mutate(across(where(is.numeric), \(x) na_if(x, number)))
2916+
2917+return(res)
2918+
2919+}
2920+
2921+
2922+
29092923 ## generic function to replace a pattern to another
29102924 ## (works only for an exact match)
29112925