sppeak: Identification of Peaks of a Mid-infrared Spectra

Description Usage Arguments Value Author(s) Examples

Description

This function allows to identify peaks of a mid-infrared spectra.

Usage

1
sppeak(spectra, span = 3, tol = 0.2)

Arguments

spectra

matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.

span

numeric. Peak detection threshold.

tol

numeric. Percentage of the maximum value of the spectrum (positive value).

Value

An object of class sppeak, which is a list of matrices for each of the spectrum.

Author(s)

Claudio Pozo Valenzuela [aut, cre] and Saddys Rodriguez-llamazares [aut]

Examples

1
2
3
4
5
6
7
8
9
data(spData)
# Convert data frame to matrix
spectra <- as.matrix(t(spData))
# List of peak detection
pks <- sppeak(spectra=spectra, span=3, tol=0.2)
# Peaks of the first spectrum
pks[[1]]
# Peaks of the second spectrum
pks[[2]]

Example output

Loading required package: pracma
             [,1]         [,2]         [,3]         [,4]         [,5]
[1,] 3980.3557700 3968.3028520 3961.5532170 3947.5718320 3942.2685480
[2,]    0.1552488    0.1561192    0.1566825    0.1581786    0.1585918
             [,6]         [,7]        [,8]         [,9]        [,10]
[1,] 3931.6619800 3923.9481120 3916.716361 3902.2528590 3898.8780420
[2,]    0.1596519    0.1602188    0.160714    0.1626401    0.1625264
           [,11]        [,12]        [,13]        [,14]        [,15]
[1,] 3891.646291 3880.5576060 3869.4689210 3862.7192870 3855.9696520
[2,]    0.163368    0.1652046    0.1670741    0.1680825    0.1695909
           [,16]        [,17]        [,18]        [,19]        [,20]
[1,] 3852.112718 3839.0955660 3831.8638150 3817.4003130 3801.9725780
[2,]    0.170078    0.1732783    0.1739309    0.1779457    0.1819154
            [,21]        [,22]        [,23]        [,24]        [,25]
[1,] 3750.3860870 3746.0470360 3733.9941180 3566.6996110 3541.1474240
[2,]    0.2000405    0.2021681    0.2085145    0.3806962    0.3848771
           [,26]        [,27]        [,28]        [,29]        [,30]
[1,] 3535.362023 3527.6481550 3522.3448710 3509.8098360 3501.1317350
[2,]    0.385132    0.3857399    0.3857457    0.3859775    0.3857644
            [,31]        [,32]       [,33]        [,34]        [,35]
[1,] 3496.3105670 3493.8999840 3487.150349 3482.3291820 3466.9014470
[2,]    0.3853945    0.3853934    0.385238    0.3852238    0.3843967
            [,36]       [,37]        [,38]       [,39]        [,40]
[1,] 3463.0445130 3456.294878 3450.5094770 3447.616777 3441.8313760
[2,]    0.3843403    0.383937    0.3835349    0.383545    0.3834322
            [,41]        [,42]        [,43]       [,44]        [,45]
[1,] 3438.4565590 3428.8142240 3419.1718900 3411.940139 3395.5481700
[2,]    0.3833434    0.3833668    0.3838772    0.384351    0.3864641
            [,46]        [,47]        [,48]        [,49]        [,50]
[1,] 3350.2291960 3336.7299280 3332.8729940 3326.1233600 3322.2664260
[2,]    0.3940023    0.3952907    0.3954282    0.3958489    0.3958548
            [,51]        [,52]        [,53]        [,54]        [,55]
[1,] 3319.3737250 3316.4810250 3309.7313910 3299.1248220 3277.9116860
[2,]    0.3958503    0.3957913    0.3957384    0.3950886    0.3927502
            [,56]        [,57]        [,58]        [,59]        [,60]
[1,] 2929.8234030 1867.2381170 1846.0249810 1841.2038140 1828.6687790
[2,]    0.3009468    0.1177905    0.1203984    0.1209864    0.1236664
            [,61]        [,62]        [,63]        [,64]        [,65]
[1,] 1701.8720770 1655.5888700 1653.6604030 1649.8034700 1558.2012900
[2,]    0.1965886    0.2589221    0.2588699    0.2586436    0.2062505
            [,66]        [,67]       [,68]        [,69]        [,70]
[1,] 1458.8852420 1423.2086040 1417.905320 1373.0684630 1340.2845250
[2,]    0.3468832    0.3505877    0.350529    0.3564417    0.3397453
            [,71]        [,72]        [,73]        [,74]        [,75]
[1,] 1302.6794200 1236.6294270 1161.4192160 1083.3163050 1015.3378450
[2,]    0.3148019    0.3434842    0.4897685    0.5018141    0.5594222
            [,76]       [,77]       [,78]       [,79]       [,80]      [,81]
[1,] 1009.0703280 988.3393082 927.5925995 854.3108557 849.4896883 763.672909
[2,]    0.5594424   0.5745512   0.3713076   0.2822128   0.2811563   0.332432
           [,82]       [,83]       [,84]       [,85]       [,86]       [,87]
[1,] 738.1207224 708.2294848 669.1780292 659.0535777 650.3754765 643.6258422
[2,]   0.2965964   0.3479266   0.3424889   0.3437366   0.3453611   0.3475671
           [,88]       [,89]       [,90]       [,91]       [,92]       [,93]
[1,] 639.2867916 608.9134372 606.0207368 597.3426355 575.1652657 554.4342461
[2,]   0.3486652   0.3862006   0.3862756   0.3868022   0.4241819   0.3849494
           [,94]       [,95]       [,96]       [,97]       [,98]       [,99]
[1,] 548.6488452 545.7561448 532.7389930 525.9893587 520.6860746 512.9722068
[2,]   0.3808092   0.3789953   0.4003526   0.4053872   0.4060613   0.3961025
          [,100]      [,101]      [,102]      [,103]      [,104]      [,105]
[1,] 507.1868060 501.8835219 498.0265880 492.2411872 485.9736696 481.6346190
[2,]   0.3906598   0.3915886   0.3866271   0.3831113   0.3792012   0.3783627
          [,106]      [,107]      [,108]      [,109]     [,110]      [,111]
[1,] 474.8849847 466.2068834 458.9751324 454.1539650 447.404331 441.1368132
[2,]   0.3816927   0.3645852   0.3681395   0.3667162   0.366205   0.3699427
          [,112]     [,113]      [,114]      [,115]      [,116]
[1,] 432.4587119 428.601778 419.9236768 411.2455756 404.4959413
[2,]   0.3839221   0.370331   0.3974815   0.3757896   0.3871529
             [,1]         [,2]         [,3]         [,4]         [,5]
[1,] 3432.6711580 3417.7255390 3410.9759050 3407.1189710 3397.9587530
[2,]    0.8540675    0.8687919    0.8731764    0.8765643    0.8812923
             [,6]         [,7]         [,8]         [,9]        [,10]
[1,] 3389.2806520 3378.6740840 3375.7813830 3368.0675160 3359.3894140
[2,]    0.8816325    0.8782572    0.8779269    0.8731145    0.8654675
            [,11]        [,12]       [,13]       [,14]        [,15]       [,16]
[1,] 3349.7470800 2930.3055200 1456.474659 1417.423203 1368.7294130 1339.802409
[2,]    0.8556609    0.3326072    0.265511    0.308115    0.3216626    0.306296
            [,17]        [,18]       [,19]       [,20]       [,21]       [,22]
[1,] 1152.7411150 1079.9414880 1021.123246 928.0747162 708.2294848 671.5886128
[2,]    0.6842798    0.8890612    1.273242   0.2600728   0.2782019   0.2683707
           [,23]       [,24]       [,25]       [,26]       [,27]       [,28]
[1,] 664.3568618 654.7145271 605.5386201 594.9320519 577.0937326 551.5415457
[2,]   0.2757175   0.2788381   0.3523392   0.3510579   0.4043109   0.3240308
           [,29]       [,30]       [,31]       [,32]       [,33]       [,34]
[1,] 546.7203783 529.3641758 521.1681913 498.0265880 491.7590704 488.3842533
[2,]   0.3209303   0.3645762   0.3448455   0.2933342   0.2853665   0.2835228
           [,35]       [,36]       [,37]      [,38]
[1,] 483.0809692 478.7419186 439.2083462 432.940829
[2,]   0.2749126   0.2753651   0.2600005   0.258883

spftir documentation built on May 2, 2019, 2:08 a.m.

Related to sppeak in spftir...