• 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ón174946cb309a680d774faf60790a7c026391b902 (tree)
Tiempo2025-01-14 20:08:11
AutorLorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I fixed the equal_within function.

Cambiar Resumen

Diferencia incremental

diff -r 951210671562 -r 174946cb309a R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Mon Jan 13 22:55:59 2025 +0100
+++ b/R-codes/stat_lib.R Tue Jan 14 12:08:11 2025 +0100
@@ -7290,10 +7290,13 @@
72907290 stop("x and y must have the same length.")
72917291 }
72927292
7293- # Check for division by zero
7293+ # Check for equality and division by zero
72947294 res <- if_else(
7295- (x == 0 | y == 0), FALSE,
7296- (abs(x - y) / abs(pmin(x, y))) <= percent / 100
7295+ x == y, TRUE, # Identical numbers always return TRUE
7296+ if_else(
7297+ (x == 0 | y == 0), FALSE, # If one is zero but not both, return FALSE
7298+ (abs(x - y) / abs(pmin(x, y))) <= percent / 100 # Otherwise, check the percentage condition
7299+ )
72977300 )
72987301
72997302 return(res)
@@ -7301,7 +7304,6 @@
73017304
73027305
73037306
7304-
73057307 ## calculate_return <- function(x) {
73067308
73077309