tests/testthat/_snaps/round5.md

round5() works

Code
  x <- seq.int(-10L, 10L, by = 1L) / 2
  x <- x[x %% 1 != 0]
  setNames(round5(x), nm = x)
Output
  -4.5 -3.5 -2.5 -1.5 -0.5  0.5  1.5  2.5  3.5  4.5 
    -5   -4   -3   -2   -1    1    2    3    4    5
Code
  x <- seq.int(-100000L, 100000L, by = 10000L) - 1L / 2L
  x <- x[x %% 1 != 0]
  setNames(round5(x), nm = x)
Output
  -100000.5  -90000.5  -80000.5  -70000.5  -60000.5  -50000.5  -40000.5  -30000.5 
    -100001    -90001    -80001    -70001    -60001    -50001    -40001    -30001 
   -20000.5  -10000.5      -0.5    9999.5   19999.5   29999.5   39999.5   49999.5 
     -20001    -10001        -1     10000     20000     30000     40000     50000 
    59999.5   69999.5   79999.5   89999.5   99999.5 
      60000     70000     80000     90000    100000
Code
  x <- seq.int(-100000L, 100000L, by = 10000L) + 1L / 2L
  x <- x[x %% 1 != 0]
  setNames(round5(x), nm = x)
Output
  -99999.5 -89999.5 -79999.5 -69999.5 -59999.5 -49999.5 -39999.5 -29999.5 
   -100000   -90000   -80000   -70000   -60000   -50000   -40000   -30000 
  -19999.5  -9999.5      0.5  10000.5  20000.5  30000.5  40000.5  50000.5 
    -20000   -10000        1    10001    20001    30001    40001    50001 
   60000.5  70000.5  80000.5  90000.5 100000.5 
     60001    70001    80001    90001   100001


Try the cards package in your browser

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

cards documentation built on Oct. 4, 2024, 1:09 a.m.