setwd("C:/Users/Maira/Desktop/Aula Miguel R/Metabolomics-package/Metabolomics-package")
source("scripts/init.R")
uv.propolis.metadata.file = "Datasets/Propolis/UVV/metadata/varredura_metadata3.csv"
uv.propolis.data.file = "Datasets/Propolis/UVV/data/varredurapositiva2.csv"

label.x = "wavelength(nm)"
label.val = "absorbance"
uv.propolis.ds = read.dataset.csv(uv.propolis.data.file, uv.propolis.metadata.file, 
                                  description = "UV data for propolis", type = "uvv-spectra", format = "row",
                                  label.x = label.x, label.values = label.val, sep.meta = ";", sep = ";")

Inspeção preliminar de dados

sum.dataset(uv.propolis.ds)
## Dataset summary:
## Valid dataset
## Description:  UV data for propolis 
## Type of data:  uvv-spectra 
## Number of samples:  195 
## Number of data points 521 
## Number of metadata variables:  5 
## Label of x-axis values:  wavelength(nm) 
## Label of data points:  absorbance 
## Number of missing values in data:  0 
## Mean of data values:  0.1777 
## Median of data values:  1e-04 
## Standard deviation:  0.56 
## Range of values:  0 4.499 
## Quantiles: 
##     0%    25%    50%    75%   100% 
## 0.0000 0.0001 0.0001 0.0200 4.4990
get.metadata(uv.propolis.ds)
##                 names   group      color seasons replicates
## VeD131_1       VeD131  sumdez        red  summer          1
## VeD131_2       VeD131  sumdez        red  summer          2
## VeD131_3       VeD131  sumdez        red  summer          3
## VeD132_1       VeD132  sumdez        red  summer          1
## VeD132_2       VeD132  sumdez        red  summer          2
## VeD132_3       VeD132  sumdez        red  summer          3
## VeD133_1       VeD133  sumdez      green  summer          1
## VeD133_2       VeD133  sumdez      green  summer          2
## VeD133_3       VeD133  sumdez      green  summer          3
## VeD134_1       VeD134  sumdez      green  summer          1
## VeD134_2       VeD134  sumdez      green  summer          2
## VeD134_3       VeD134  sumdez      green  summer          3
## VeF141_1       VeF141  sumfev      green  summer          1
## VeF141_2       VeF141  sumfev      green  summer          2
## VeF141_3       VeF141  sumfev      green  summer          3
## VeF142_1       VeF142  sumfev      green  summer          1
## VeF142_2       VeF142  sumfev      green  summer          2
## VeF142_3       VeF142  sumfev      green  summer          3
## VeF143_1       VeF143  sumfev      green  summer          1
## VeF143_2       VeF143  sumfev      green  summer          2
## VeF143_3       VeF143  sumfev      green  summer          3
## VeF144_1       VeF144  sumfev      green  summer          1
## VeF144_2       VeF144  sumfev      green  summer          2
## VeF144_3       VeF144  sumfev      green  summer          3
## VeF145_1       VeF145  sumfev      green  summer          1
## VeF145_2       VeF145  sumfev      green  summer          2
## VeF145_3       VeF145  sumfev      green  summer          3
## VeF146_1       VeF146  sumfev      green  summer          1
## VeF146_2       VeF146  sumfev      green  summer          2
## VeF146_3       VeF146  sumfev      green  summer          3
## VeF147_1       VeF147  sumfev      green  summer          1
## VeF147_2       VeF147  sumfev      green  summer          2
## VeF147_3       VeF147  sumfev      green  summer          3
## VeJ1411_1     VeJ1411  sumjan      green  summer          1
## VeJ1411_2     VeJ1411  sumjan      green  summer          2
## VeJ1411_3     VeJ1411  sumjan      green  summer          3
## VeJ1412_1     VeJ1412  sumjan      green  summer          1
## VeJ1412_2     VeJ1412  sumjan      green  summer          2
## VeJ1412_3     VeJ1412  sumjan      green  summer          3
## VeJ1413_1     VeJ1412  sumjan      green  summer          1
## VeJ1413_2     VeJ1412  sumjan      green  summer          2
## VeJ1413_3     VeJ1412  sumjan      green  summer          3
## VeJ1414_1     VeJ1414  sumjan      green  summer          1
## VeJ1414_2     VeJ1414  sumjan      green  summer          2
## VeJ1414_3     VeJ1414  sumjan      green  summer          3
## VeJ1421_1     VeJ1421  sumjan      green  summer          1
## VeJ1421_2     VeJ1421  sumjan      green  summer          2
## VeJ1421_3     VeJ1421  sumjan      green  summer          3
## VeJ1422_1     VeJ1422  sumjan      green  summer          1
## VeJ1422_2     VeJ1422  sumjan      green  summer          2
## VeJ1422_3     VeJ1422  sumjan      green  summer          3
## VeJ1423_1     VeJ1423  sumjan      green  summer          1
## VeJ1423_2     VeJ1423  sumjan      green  summer          2
## VeJ1423_3     VeJ1423  sumjan      green  summer          3
## VeJ1424_1     VeJ1424  sumjan      green  summer          1
## VeJ1424_2     VeJ1424  sumjan      green  summer          2
## VeJ1424_3     VeJ1424  sumjan      green  summer          3
## VeJ1431_1     VeJ1431  sumjan      brown  summer          1
## VeJ1431_2     VeJ1431  sumjan      brown  summer          2
## VeJ1431_3     VeJ1431  sumjan      brown  summer          3
## VeJ1432_1     VeJ1432  sumjan      green  summer          1
## VeJ1432_2     VeJ1432  sumjan      green  summer          2
## VeJ1432_3     VeJ1432  sumjan      green  summer          3
## VeJ1433_1     VeJ1433  sumjan      green  summer          1
## VeJ1433_2     VeJ1433  sumjan      green  summer          2
## VeJ1433_3     VeJ1433  sumjan      green  summer          3
## VeJ1434_1     VeJ1434  sumjan      green  summer          1
## VeJ1434_2     VeJ1434  sumjan      green  summer          2
## VeJ1434_3     VeJ1434  sumjan      green  summer          3
## MVeJ141_1     MVeJ141 sumjan2 brownwhite  summer          1
## MVeJ141_2     MVeJ141 sumjan2 brownwhite  summer          2
## MVeJ141_3     MVeJ141 sumjan2 brownwhite  summer          3
## MVeJ142_1     MVeJ142 sumjan2 brownwhite  summer          1
## MVeJ142_2     MVeJ142 sumjan2 brownwhite  summer          2
## MVeJ142_3     MVeJ142 sumjan2 brownwhite  summer          3
## MVeJ143_1     MVeJ143 sumjan2      brown  summer          1
## MVeJ143_2     MVeJ143 sumjan2      brown  summer          2
## MVeJ143_3     MVeJ143 sumjan2      brown  summer          3
## MVeJ144_1     MVeJ144 sumjan2 brownwhite  summer          1
## MVeJ144_2     MVeJ144 sumjan2 brownwhite  summer          2
## MVeJ144_3     MVeJ144 sumjan2 brownwhite  summer          3
## MVeJ145_1     MVeJ145 sumjan2 brownwhite  summer          1
## MVeJ145_2     MVeJ145 sumjan2 brownwhite  summer          2
## MVeJ145_3     MVeJ145 sumjan2 brownwhite  summer          3
## OutM141_1     OutM141  autmay      brown  autumn          1
## OutM141_2     OutM141  autmay      brown  autumn          2
## OutM141_3     OutM141  autmay      brown  autumn          3
## OutM142_1     OutM142  autmay brownwhite  autumn          1
## OutM142_2     OutM142  autmay brownwhite  autumn          2
## OutM142_3     OutM142  autmay brownwhite  autumn          3
## OutM143_1     OutM143  autmay      brown  autumn          1
## OutM143_2     OutM143  autmay      brown  autumn          2
## OutM143_3     OutM143  autmay      brown  autumn          3
## OutM144_1     OutM144  autmay      brown  autumn          1
## OutM144_2     OutM144  autmay      brown  autumn          2
## OutM144_3     OutM144  autmay      brown  autumn          3
## OutM145_1     OutM145  autmay        red  autumn          1
## OutM145_2     OutM145  autmay        red  autumn          2
## OutM145_3     OutM145  autmay        red  autumn          3
## In14Ap11_1   In14Ap11    wint      green  winter          1
## In14Ap11_2   In14Ap11    wint      green  winter          2
## In14Ap11_3   In14Ap11    wint      green  winter          3
## In14Ap12_1   In14Ap12    wint      brown  winter          1
## In14Ap12_2   In14Ap12    wint      brown  winter          2
## In14Ap12_3   In14Ap12    wint      brown  winter          3
## In14Ap21_1   In14Ap21    wint      green  winter          1
## In14Ap21_2   In14Ap21    wint      green  winter          2
## In14Ap21_3   In14Ap21    wint      green  winter          3
## In14Ap22_1   In14Ap22    wint      green  winter          1
## In14Ap22_2   In14Ap22    wint      green  winter          2
## In14Ap22_3   In14Ap22    wint      green  winter          3
## In14Ap23_1   In14Ap23    wint      green  winter          1
## In14Ap23_2   In14Ap23    wint      green  winter          2
## In14Ap23_3   In14Ap23    wint      green  winter          3
## In14Ap24_1   In14Ap24    wint      brown  winter          1
## In14Ap24_2   In14Ap24    wint      brown  winter          2
## In14Ap24_3   In14Ap24    wint      brown  winter          3
## In14Ap31_1   In14Ap31    wint      green  winter          1
## In14Ap31_2   In14Ap31    wint      green  winter          2
## In14Ap31_3   In14Ap31    wint      green  winter          3
## In14Ap32_1   In14Ap32    wint      green  winter          1
## In14Ap32_2   In14Ap32    wint      green  winter          2
## In14Ap32_3   In14Ap32    wint      green  winter          3
## In14Ap33_1   In14Ap33    wint      green  winter          1
## In14Ap33_2   In14Ap33    wint      green  winter          2
## In14Ap33_3   In14Ap33    wint      green  winter          3
## In14Ap34_1   In14Ap34    wint      green  winter          1
## In14Ap34_2   In14Ap34    wint      green  winter          2
## In14Ap34_3   In14Ap34    wint      green  winter          3
## In14Ap41_1   In14Ap41    wint      green  winter          1
## In14Ap41_2   In14Ap41    wint      green  winter          2
## In14Ap41_3   In14Ap41    wint      green  winter          3
## In14Ap42_1   In14Ap42    wint      brown  winter          1
## In14Ap42_2   In14Ap42    wint      brown  winter          2
## In14Ap42_3   In14Ap42    wint      brown  winter          3
## Pri14Ap11_1 Pri14Ap11    spri      green  spring          1
## Pri14Ap11_2 Pri14Ap11    spri      green  spring          2
## Pri14Ap11_3 Pri14Ap11    spri      green  spring          3
## Pri14Ap12_1 Pri14Ap12    spri brownwhite  spring          1
## Pri14Ap12_2 Pri14Ap12    spri brownwhite  spring          2
## Pri14Ap12_3 Pri14Ap12    spri brownwhite  spring          3
## Pri14Ap21_1 Pri14Ap21    spri      green  spring          1
## Pri14Ap21_2 Pri14Ap21    spri      green  spring          2
## Pri14Ap21_3 Pri14Ap21    spri      green  spring          3
## Pri14Ap22_1 Pri14Ap22    spri      brown  spring          1
## Pri14Ap22_2 Pri14Ap22    spri      brown  spring          2
## Pri14Ap22_3 Pri14Ap22    spri      brown  spring          3
## Pri14Ap23_1 Pri14Ap23    spri      brown  spring          1
## Pri14Ap23_2 Pri14Ap23    spri      brown  spring          2
## Pri14Ap23_3 Pri14Ap23    spri      brown  spring          3
## Pri14Ap24_1 Pri14Ap24    spri      green  spring          1
## Pri14Ap24_2 Pri14Ap24    spri      green  spring          2
## Pri14Ap24_3 Pri14Ap24    spri      green  spring          3
## Pri14Ap31_1 Pri14Ap31    spri      green  spring          1
## Pri14Ap31_2 Pri14Ap31    spri      green  spring          2
## Pri14Ap31_3 Pri14Ap31    spri      green  spring          3
## Pri14Ap32_1 Pri14Ap32    spri brownwhite  spring          1
## Pri14Ap32_2 Pri14Ap32    spri brownwhite  spring          2
## Pri14Ap32_3 Pri14Ap32    spri brownwhite  spring          3
## Pri14Ap41_1 Pri14Ap41    spri      brown  spring          1
## Pri14Ap41_2 Pri14Ap41    spri      brown  spring          2
## Pri14Ap41_3 Pri14Ap41    spri      brown  spring          3
## Pri14Ap42_1 Pri14Ap42    spri      brown  spring          1
## Pri14Ap42_2 Pri14Ap42    spri      brown  spring          2
## Pri14Ap42_3 Pri14Ap42    spri      brown  spring          3
## EpaP111_1     EpaP111  epagri      brown  spring          1
## EpaP111_2     EpaP111  epagri      brown  spring          2
## EpaP111_3     EpaP111  epagri      brown  spring          3
## EpaP112_1     EpaP112  epagri      green  spring          1
## EpaP112_2     EpaP112  epagri      green  spring          2
## EpaP112_3     EpaP112  epagri      green  spring          3
## EpaP113_1     EpaP113  epagri      brown  spring          1
## EpaP113_2     EpaP113  epagri      brown  spring          2
## EpaP113_3     EpaP113  epagri      brown  spring          3
## EpaP114_1     EpaP114  epagri      green  spring          1
## EpaP114_2     EpaP114  epagri      green  spring          2
## EpaP114_3     EpaP114  epagri      green  spring          3
## EpaP115_1     EpaP115  epagri        red  spring          1
## EpaP115_2     EpaP115  epagri        red  spring          2
## EpaP115_3     EpaP115  epagri        red  spring          3
## EpaV111_1     EpaV111  epagri      green  summer          1
## EpaV111_2     EpaV111  epagri      green  summer          2
## EpaV111_3     EpaV111  epagri      green  summer          3
## EpaV112_1     EpaV112  epagri      green  summer          1
## EpaV112_2     EpaV112  epagri      green  summer          2
## EpaV112_3     EpaV112  epagri      green  summer          3
## EpaV113_1     EpaV113  epagri      green  summer          1
## EpaV113_2     EpaV113  epagri      green  summer          2
## EpaV113_3     EpaV113  epagri      green  summer          3
## EpaV114_1     EpaV114  epagri      green  summer          1
## EpaV114_2     EpaV114  epagri      green  summer          2
## EpaV114_3     EpaV114  epagri      green  summer          3
## EpaV115_1     EpaV115  epagri      brown  summer          1
## EpaV115_2     EpaV115  epagri      brown  summer          2
## EpaV115_3     EpaV115  epagri      brown  summer          3

Dados de UV-visível (400-500 nm)

Plotando o espectro

plot.spectra(uv.propolis.ds,"seasons")

plot of chunk unnamed-chunk-3

Pré-processamento de dados

Smoothing e correção da linha de base

uv.propolis.wavelens = get.x.values.as.num(uv.propolis.ds)
x.axis.sm = seq(min(uv.propolis.wavelens), max(uv.propolis.wavelens),10)
uv.propolis.smooth = smoothing.interpolation(uv.propolis.ds, method = "loess", x.axis = x.axis.sm)
plot.spectra(uv.propolis.smooth, "seasons")

plot of chunk unnamed-chunk-4

uv.propolis.bg = data.correction(uv.propolis.smooth,"background")
uv.propolis.offset = data.correction(uv.propolis.bg, "offset")
uv.propolis.baseline = data.correction(uv.propolis.offset, "baseline")
sum.dataset(uv.propolis.baseline)
## Dataset summary:
## Valid dataset
## Description:  UV data for propolis-smoothed with hyperSpec spc.loess; background correction; offset correction; baseline correction 
## Type of data:  undefined 
## Number of samples:  195 
## Number of data points 53 
## Number of metadata variables:  5 
## Label of x-axis values:  wavelength(nm) 
## Label of data points:  absorbance 
## Number of missing values in data:  0 
## Mean of data values:  0.1701 
## Median of data values:  0.05404 
## Standard deviation:  0.3568 
## Range of values:  -0.0003441 3.201 
## Quantiles: 
##         0%        25%        50%        75%       100% 
## -0.0003441  0.0125231  0.0540368  0.1703715  3.2009635
plot.spectra(uv.propolis.baseline, "seasons")

plot of chunk unnamed-chunk-4

Análise de Cluster

uv.propolis.hc = clustering(uv.propolis.ds, method = "hc", distance = "euclidean")
dendrogram.plot(uv.propolis.ds, uv.propolis.hc)

plot of chunk unnamed-chunk-5

dendrogram.plot.col(uv.propolis.ds, uv.propolis.hc, "seasons")

plot of chunk unnamed-chunk-5

Análise Componentes Principais

uv.propolis.pca = pca.analysis.dataset(uv.propolis.ds)
summary(uv.propolis.pca)
## Importance of components:
##                           PC1   PC2   PC3   PC4    PC5     PC6     PC7
## Standard deviation     18.712 8.400 7.946 5.255 2.3573 1.00080 0.89599
## Proportion of Variance  0.672 0.135 0.121 0.053 0.0107 0.00192 0.00154
## Cumulative Proportion   0.672 0.807 0.929 0.982 0.9923 0.99426 0.99580
##                            PC8     PC9   PC10    PC11    PC12    PC13
## Standard deviation     0.74847 0.63524 0.4564 0.41450 0.37343 0.30738
## Proportion of Variance 0.00108 0.00077 0.0004 0.00033 0.00027 0.00018
## Cumulative Proportion  0.99687 0.99765 0.9980 0.99838 0.99864 0.99883
##                           PC14    PC15    PC16    PC17    PC18    PC19
## Standard deviation     0.26591 0.23913 0.20958 0.19265 0.18406 0.17072
## Proportion of Variance 0.00014 0.00011 0.00008 0.00007 0.00007 0.00006
## Cumulative Proportion  0.99896 0.99907 0.99916 0.99923 0.99929 0.99935
##                           PC20    PC21    PC22    PC23    PC24    PC25
## Standard deviation     0.16001 0.15691 0.14466 0.14103 0.13426 0.12533
## Proportion of Variance 0.00005 0.00005 0.00004 0.00004 0.00003 0.00003
## Cumulative Proportion  0.99940 0.99944 0.99948 0.99952 0.99956 0.99959
##                           PC26    PC27    PC28    PC29    PC30    PC31
## Standard deviation     0.11924 0.11785 0.11037 0.10466 0.10069 0.09908
## Proportion of Variance 0.00003 0.00003 0.00002 0.00002 0.00002 0.00002
## Cumulative Proportion  0.99961 0.99964 0.99966 0.99969 0.99970 0.99972
##                           PC32    PC33    PC34    PC35    PC36    PC37
## Standard deviation     0.09703 0.09146 0.08563 0.08297 0.07915 0.07785
## Proportion of Variance 0.00002 0.00002 0.00001 0.00001 0.00001 0.00001
## Cumulative Proportion  0.99974 0.99976 0.99977 0.99979 0.99980 0.99981
##                           PC38    PC39    PC40    PC41    PC42    PC43
## Standard deviation     0.07460 0.07246 0.07190 0.07074 0.06563 0.06411
## Proportion of Variance 0.00001 0.00001 0.00001 0.00001 0.00001 0.00001
## Cumulative Proportion  0.99982 0.99983 0.99984 0.99985 0.99986 0.99987
##                           PC44    PC45    PC46    PC47    PC48    PC49
## Standard deviation     0.06355 0.06212 0.06104 0.05770 0.05625 0.05401
## Proportion of Variance 0.00001 0.00001 0.00001 0.00001 0.00001 0.00001
## Cumulative Proportion  0.99987 0.99988 0.99989 0.99989 0.99990 0.99991
##                           PC50   PC51   PC52   PC53   PC54   PC55   PC56
## Standard deviation     0.05266 0.0508 0.0489 0.0482 0.0474 0.0469 0.0444
## Proportion of Variance 0.00001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## Cumulative Proportion  0.99991 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999
##                          PC57   PC58  PC59   PC60   PC61   PC62   PC63
## Standard deviation     0.0437 0.0422 0.041 0.0396 0.0389 0.0384 0.0366
## Proportion of Variance 0.0000 0.0000 0.000 0.0000 0.0000 0.0000 0.0000
## Cumulative Proportion  0.9999 0.9999 1.000 1.0000 1.0000 1.0000 1.0000
##                          PC64   PC65   PC66   PC67   PC68   PC69   PC70
## Standard deviation     0.0349 0.0346 0.0344 0.0337 0.0325 0.0316 0.0308
## Proportion of Variance 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
##                          PC71   PC72   PC73   PC74   PC75   PC76   PC77
## Standard deviation     0.0286 0.0269 0.0264 0.0257 0.0252 0.0246 0.0237
## Proportion of Variance 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
##                          PC78   PC79  PC80 PC81   PC82   PC83   PC84
## Standard deviation     0.0231 0.0213 0.021 0.02 0.0193 0.0186 0.0184
## Proportion of Variance 0.0000 0.0000 0.000 0.00 0.0000 0.0000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.000 1.00 1.0000 1.0000 1.0000
##                          PC85   PC86   PC87  PC88   PC89  PC90   PC91
## Standard deviation     0.0183 0.0177 0.0176 0.017 0.0167 0.016 0.0155
## Proportion of Variance 0.0000 0.0000 0.0000 0.000 0.0000 0.000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.000 1.0000 1.000 1.0000
##                          PC92   PC93   PC94   PC95   PC96   PC97   PC98
## Standard deviation     0.0151 0.0149 0.0147 0.0135 0.0129 0.0127 0.0126
## Proportion of Variance 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
##                          PC99  PC100  PC101  PC102 PC103  PC104  PC105
## Standard deviation     0.0121 0.0119 0.0118 0.0113 0.011 0.0108 0.0105
## Proportion of Variance 0.0000 0.0000 0.0000 0.0000 0.000 0.0000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.0000 1.000 1.0000 1.0000
##                          PC106  PC107  PC108   PC109   PC110   PC111
## Standard deviation     0.00988 0.0098 0.0094 0.00917 0.00897 0.00883
## Proportion of Variance 0.00000 0.0000 0.0000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.0000 1.0000 1.00000 1.00000 1.00000
##                          PC112   PC113   PC114  PC115   PC116   PC117
## Standard deviation     0.00862 0.00823 0.00812 0.0079 0.00777 0.00756
## Proportion of Variance 0.00000 0.00000 0.00000 0.0000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.0000 1.00000 1.00000
##                          PC118   PC119   PC120   PC121   PC122   PC123
## Standard deviation     0.00734 0.00699 0.00683 0.00665 0.00629 0.00625
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC124   PC125   PC126   PC127   PC128   PC129
## Standard deviation     0.00619 0.00604 0.00598 0.00565 0.00549 0.00542
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                         PC130   PC131   PC132   PC133   PC134   PC135
## Standard deviation     0.0053 0.00517 0.00498 0.00492 0.00474 0.00454
## Proportion of Variance 0.0000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.0000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC136   PC137   PC138   PC139   PC140   PC141
## Standard deviation     0.00449 0.00439 0.00422 0.00418 0.00407 0.00374
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC142   PC143   PC144   PC145   PC146   PC147
## Standard deviation     0.00365 0.00359 0.00345 0.00338 0.00327 0.00313
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC148   PC149   PC150   PC151   PC152   PC153
## Standard deviation     0.00303 0.00294 0.00286 0.00285 0.00279 0.00263
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC154   PC155   PC156   PC157   PC158   PC159
## Standard deviation     0.00251 0.00246 0.00241 0.00225 0.00217 0.00212
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC160   PC161   PC162   PC163   PC164   PC165
## Standard deviation     0.00205 0.00192 0.00189 0.00179 0.00171 0.00164
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC166   PC167  PC168   PC169   PC170   PC171
## Standard deviation     0.00151 0.00143 0.0014 0.00131 0.00124 0.00115
## Proportion of Variance 0.00000 0.00000 0.0000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.0000 1.00000 1.00000 1.00000
##                          PC172   PC173 PC174    PC175    PC176    PC177
## Standard deviation     0.00111 0.00102 0.001 0.000905 0.000899 0.000864
## Proportion of Variance 0.00000 0.00000 0.000 0.000000 0.000000 0.000000
## Cumulative Proportion  1.00000 1.00000 1.000 1.000000 1.000000 1.000000
##                           PC178    PC179    PC180    PC181   PC182
## Standard deviation     0.000797 0.000756 0.000658 0.000604 0.00056
## Proportion of Variance 0.000000 0.000000 0.000000 0.000000 0.00000
## Cumulative Proportion  1.000000 1.000000 1.000000 1.000000 1.00000
##                           PC183    PC184    PC185    PC186    PC187
## Standard deviation     0.000529 0.000479 0.000432 0.000423 0.000378
## Proportion of Variance 0.000000 0.000000 0.000000 0.000000 0.000000
## Cumulative Proportion  1.000000 1.000000 1.000000 1.000000 1.000000
##                           PC188    PC189 PC190    PC191    PC192    PC193
## Standard deviation     0.000361 0.000225 7e-05 3.63e-05 8.31e-15 1.53e-15
## Proportion of Variance 0.000000 0.000000 0e+00 0.00e+00 0.00e+00 0.00e+00
## Cumulative Proportion  1.000000 1.000000 1e+00 1.00e+00 1.00e+00 1.00e+00
##                           PC194    PC195
## Standard deviation     1.53e-15 1.53e-15
## Proportion of Variance 0.00e+00 0.00e+00
## Cumulative Proportion  1.00e+00 1.00e+00
pca.scoresplot3D(uv.propolis.ds, uv.propolis.pca, "seasons")
## Loading required package: scatterplot3d

plot of chunk unnamed-chunk-6

pca.scoresplot2D(uv.propolis.ds, uv.propolis.pca, "seasons", ellipses=T, pallette=2)

plot of chunk unnamed-chunk-6

** String - Cluster e PCA**

uv.propolis.string = subset.x.values.by.interval(uv.propolis.ds, min.value = 280, max.value = 350)
sum.dataset(uv.propolis.string)
## Dataset summary:
## Valid dataset
## Description:  UV data for propolis 
## Type of data:  uvv-spectra 
## Number of samples:  195 
## Number of data points 71 
## Number of metadata variables:  5 
## Label of x-axis values:  wavelength(nm) 
## Label of data points:  absorbance 
## Number of missing values in data:  0 
## Mean of data values:  1.106 
## Median of data values:  0.665 
## Standard deviation:  1.108 
## Range of values:  0 4.499 
## Quantiles: 
##    0%   25%   50%   75%  100% 
## 0.000 0.056 0.665 2.033 4.499
plot.spectra(uv.propolis.string, "seasons", legend="topleft")

plot of chunk unnamed-chunk-7

uv.propolis.string.pca = pca.analysis.dataset(uv.propolis.string, scale = T, center = T)
summary(uv.propolis.string.pca)
## Importance of components:
##                          PC1   PC2     PC3     PC4     PC5     PC6     PC7
## Standard deviation     7.730 3.203 0.59791 0.44638 0.36799 0.19167 0.17365
## Proportion of Variance 0.842 0.145 0.00504 0.00281 0.00191 0.00052 0.00042
## Cumulative Proportion  0.842 0.986 0.99124 0.99404 0.99595 0.99647 0.99689
##                            PC8     PC9    PC10    PC11    PC12    PC13
## Standard deviation     0.15274 0.14367 0.13105 0.12880 0.11482 0.11068
## Proportion of Variance 0.00033 0.00029 0.00024 0.00023 0.00019 0.00017
## Cumulative Proportion  0.99722 0.99751 0.99775 0.99799 0.99817 0.99835
##                           PC14    PC15    PC16    PC17    PC18    PC19
## Standard deviation     0.10471 0.09841 0.09156 0.08969 0.08706 0.08061
## Proportion of Variance 0.00015 0.00014 0.00012 0.00011 0.00011 0.00009
## Cumulative Proportion  0.99850 0.99864 0.99875 0.99887 0.99897 0.99907
##                           PC20    PC21    PC22    PC23    PC24    PC25
## Standard deviation     0.07872 0.07708 0.07112 0.06825 0.06699 0.06263
## Proportion of Variance 0.00009 0.00008 0.00007 0.00007 0.00006 0.00006
## Cumulative Proportion  0.99915 0.99924 0.99931 0.99937 0.99944 0.99949
##                           PC26    PC27    PC28    PC29    PC30    PC31
## Standard deviation     0.05985 0.05681 0.05558 0.05210 0.04974 0.04778
## Proportion of Variance 0.00005 0.00005 0.00004 0.00004 0.00003 0.00003
## Cumulative Proportion  0.99954 0.99959 0.99963 0.99967 0.99970 0.99974
##                           PC32    PC33    PC34    PC35    PC36    PC37
## Standard deviation     0.04636 0.04551 0.04270 0.03871 0.03720 0.03592
## Proportion of Variance 0.00003 0.00003 0.00003 0.00002 0.00002 0.00002
## Cumulative Proportion  0.99977 0.99980 0.99982 0.99984 0.99986 0.99988
##                           PC38    PC39    PC40    PC41    PC42    PC43
## Standard deviation     0.03221 0.03070 0.03039 0.02835 0.02554 0.02328
## Proportion of Variance 0.00001 0.00001 0.00001 0.00001 0.00001 0.00001
## Cumulative Proportion  0.99990 0.99991 0.99992 0.99993 0.99994 0.99995
##                           PC44    PC45    PC46  PC47  PC48   PC49   PC50
## Standard deviation     0.02163 0.02151 0.01990 0.018 0.017 0.0155 0.0146
## Proportion of Variance 0.00001 0.00001 0.00001 0.000 0.000 0.0000 0.0000
## Cumulative Proportion  0.99996 0.99996 0.99997 1.000 1.000 1.0000 1.0000
##                          PC51   PC52   PC53   PC54    PC55    PC56   PC57
## Standard deviation     0.0139 0.0131 0.0125 0.0106 0.00989 0.00912 0.0083
## Proportion of Variance 0.0000 0.0000 0.0000 0.0000 0.00000 0.00000 0.0000
## Cumulative Proportion  1.0000 1.0000 1.0000 1.0000 0.99999 0.99999 1.0000
##                           PC58    PC59    PC60    PC61    PC62    PC63
## Standard deviation     0.00761 0.00707 0.00645 0.00609 0.00501 0.00456
## Proportion of Variance 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000 1.00000 1.00000 1.00000 1.00000
##                          PC64    PC65    PC66    PC67    PC68  PC69
## Standard deviation     0.0039 0.00336 0.00294 0.00254 0.00224 0.002
## Proportion of Variance 0.0000 0.00000 0.00000 0.00000 0.00000 0.000
## Cumulative Proportion  1.0000 1.00000 1.00000 1.00000 1.00000 1.000
##                           PC70    PC71
## Standard deviation     0.00183 0.00139
## Proportion of Variance 0.00000 0.00000
## Cumulative Proportion  1.00000 1.00000
pca.scoresplot2D(uv.propolis.string, uv.propolis.string.pca, pcas = c(1,2), "seasons", labels="F", pallette=2, ellipses="T")

plot of chunk unnamed-chunk-7

uv.propolis.string.hc = clustering(uv.propolis.string, method = "hc", distance = "euclidean")
uv.propolis.string.hc
## 
## Call:
## hclust(d = dist.matrix, method = clustMethod)
## 
## Cluster method   : complete 
## Distance         : euclidean 
## Number of objects: 195
dendrogram.plot(uv.propolis.string, uv.propolis.string.hc)

plot of chunk unnamed-chunk-7

dendrogram.plot.col(uv.propolis.string, uv.propolis.string.hc, "seasons")