tests/testthat/_snaps/num-rsq.md

na_rm argument check

Code
  rsq_vec(1, 1, na_rm = "yes")
Condition
  Error in `rsq_vec()`:
  ! `na_rm` must be `TRUE` or `FALSE`, not the string "yes".

yardstick correlation warnings are thrown

Code
  (expect_warning(object = out <- rsq_vec(1, 1), class = "yardstick_warning_correlation_undefined_size_zero_or_one")
  )
Output
  <warning/yardstick_warning_correlation_undefined_size_zero_or_one>
  Warning:
  A correlation computation is required, but the inputs are size zero or one and the standard deviation cannot be computed. `NA` will be returned.
Code
  (expect_warning(object = out <- rsq_vec(double(), double()), class = "yardstick_warning_correlation_undefined_size_zero_or_one")
  )
Output
  <warning/yardstick_warning_correlation_undefined_size_zero_or_one>
  Warning:
  A correlation computation is required, but the inputs are size zero or one and the standard deviation cannot be computed. `NA` will be returned.
Code
  (expect_warning(object = out <- rsq_vec(c(1, 2), c(1, 1)), class = "yardstick_warning_correlation_undefined_constant_estimate")
  )
Output
  <warning/yardstick_warning_correlation_undefined_constant_estimate>
  Warning:
  A correlation computation is required, but `estimate` is constant and has 0 standard deviation, resulting in a divide by 0 error. `NA` will be returned.
Code
  (expect_warning(object = out <- rsq_vec(c(1, 1), c(1, 2)), class = "yardstick_warning_correlation_undefined_constant_truth")
  )
Output
  <warning/yardstick_warning_correlation_undefined_constant_truth>
  Warning:
  A correlation computation is required, but `truth` is constant and has 0 standard deviation, resulting in a divide by 0 error. `NA` will be returned.


Try the yardstick package in your browser

Any scripts or data that you put into this service are public.

yardstick documentation built on April 8, 2026, 1:06 a.m.