tests/testthat/_snaps/prep_smooth.md

Savitzky-Golay smoothing returns correct result

Code
  round_result(process(X, prep_smooth(w = 3, p = 2, algorithm = "savitzky-golay")))
Output
           1301     1304     1307     1310     1313     1316     1319     1322
  [1,] 0.205302 0.204501 0.203731 0.203206 0.202756 0.202576 0.202786 0.202692
  [2,] 0.131879 0.131447 0.131176 0.131124 0.131113 0.131402 0.132035 0.132560
           1325     1328     1331     1334     1337     1340     1343     1346
  [1,] 0.202879 0.203611 0.204288 0.205184 0.206636 0.207888 0.209279 0.211303
  [2,] 0.133254 0.134562 0.135814 0.137314 0.139394 0.141347 0.143218 0.145561
           1349     1352     1355     1358     1361     1364     1367     1370
  [1,] 0.213379 0.215886 0.218953 0.221455 0.223550 0.225566 0.227768 0.230235
  [2,] 0.147873 0.150523 0.153605 0.156549 0.159199 0.161878 0.164573 0.167294
           1373     1376     1379     1382     1385     1388     1391     1394
  [1,] 0.232188 0.234819 0.237829 0.241579 0.245791 0.250242 0.254739 0.258840
  [2,] 0.169566 0.172488 0.175737 0.179639 0.183824 0.188221 0.192845 0.197415
           1397     1400     1403     1406     1409     1412     1415     1418
  [1,] 0.263033 0.267465 0.272131 0.277510 0.283385 0.289131 0.296411 0.303453
  [2,] 0.202303 0.207404 0.212511 0.218193 0.224256 0.230260 0.236930 0.243407
           1421     1424     1427     1430     1433     1436     1439     1442
  [1,] 0.309894 0.316281 0.322130 0.327445 0.332152 0.336120 0.338945 0.341312
  [2,] 0.249606 0.255815 0.261389 0.266325 0.270837 0.274737 0.277849 0.280876
           1445
  [1,] 0.342502
  [2,] 0.283104
  attr(,"preprocess_recipe")
  Spectral preprocessing recipe (device: "unspecified"): 
   - Step 1: prep_smooth
      w: 3; p: 2; algorithm: 'savitzky-golay'
  attr(,"processed_wavs")
  Spectral variables by preprocessing step:
    step_0: 51 spectral variables
    step_1: 49 spectral variables

Moving average returns correct result

Code
  round_result(process(X, prep_smooth(w = 3, algorithm = "moving-average")))
Output
           1298     1301     1304     1307     1310     1313     1316     1319
  [1,] 0.205594 0.205230 0.204511 0.203813 0.203231 0.202846 0.202706 0.202685
  [2,] 0.131981 0.131803 0.131501 0.131249 0.131138 0.131213 0.131516 0.131999
           1322     1325     1328     1331     1334     1337     1340     1343
  [1,] 0.202786 0.203061 0.203592 0.204361 0.205369 0.206569 0.207934 0.209490
  [2,] 0.132616 0.133458 0.134543 0.135897 0.137507 0.139352 0.141320 0.143375
           1346     1349     1352     1355     1358     1361     1364     1367
  [1,] 0.211320 0.213523 0.216073 0.218765 0.221319 0.223524 0.225628 0.227856
  [2,] 0.145551 0.147986 0.150667 0.153559 0.156451 0.159209 0.161883 0.164582
           1370     1373     1376     1379     1382     1385     1388     1391
  [1,] 0.230064 0.232414 0.234945 0.238076 0.241733 0.245871 0.250257 0.254607
  [2,] 0.167144 0.169783 0.172597 0.175954 0.179733 0.183895 0.188297 0.192827
           1394     1397     1400     1403     1406     1409     1412     1415
  [1,] 0.258870 0.263112 0.267543 0.272369 0.277675 0.283342 0.289643 0.296332
  [2,] 0.197521 0.202374 0.207406 0.212703 0.218320 0.224236 0.230482 0.236866
           1418     1421     1424     1427     1430     1433     1436     1439
  [1,] 0.303253 0.309876 0.316102 0.321952 0.327243 0.331906 0.335739 0.338792
  [2,] 0.243314 0.249609 0.255603 0.261176 0.266184 0.270633 0.274474 0.277821
          1442     1445     1448
  [1,] 0.34092 0.342458 0.343030
  [2,] 0.28061 0.283045 0.284129
  attr(,"preprocess_recipe")
  Spectral preprocessing recipe (device: "unspecified"): 
   - Step 1: prep_smooth
      w: 3; algorithm: 'moving-average'
  attr(,"processed_wavs")
  Spectral variables by preprocessing step:
    step_0: 51 spectral variables
    step_1: 51 spectral variables


Try the proximetricsR package in your browser

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

proximetricsR documentation built on Sept. 4, 2026, 5:08 p.m.