library(languageR)
 head(dutchSpeakersDist)
##      V1    V2    V3    V4    V5    V6    V7    V8    V9   V10   V11   V12
## 1 2.226 3.657 3.748 3.496 3.603 3.662 3.722 3.710 3.631 3.692 3.654 3.574
## 2 3.657 1.928 3.738 3.486 3.573 3.606 3.647 3.663 3.427 3.527 3.541 3.514
## 3 3.748 3.738 0.840 3.607 3.536 3.698 3.712 3.661 3.583 3.656 3.562 3.567
## 4 3.496 3.486 3.607 2.096 3.334 3.325 3.529 3.482 3.374 3.364 3.355 3.343
## 5 3.603 3.573 3.536 3.334 1.848 3.471 3.520 3.601 3.379 3.530 3.455 3.456
## 6 3.662 3.606 3.698 3.325 3.471 0.416 3.619 3.660 3.369 3.482 3.456 3.436
##     V13   V14   V15   V16   V17   V18   V19   V20   V21   V22   V23   V24
## 1 3.729 3.807 3.741 3.586 3.624 3.690 3.634 3.706 3.662 3.658 3.614 3.765
## 2 3.575 3.574 3.543 3.614 3.555 3.659 3.575 3.751 3.631 3.530 3.381 3.793
## 3 3.595 3.763 3.679 3.599 3.667 3.611 3.692 3.724 3.649 3.552 3.537 3.749
## 4 3.453 3.389 3.374 3.393 3.394 3.362 3.439 3.545 3.398 3.401 3.330 3.617
## 5 3.491 3.651 3.518 3.469 3.389 3.475 3.567 3.569 3.430 3.463 3.338 3.740
## 6 3.422 3.522 3.489 3.494 3.482 3.292 3.471 3.567 3.467 3.515 3.275 3.784
##     V25   V26   V27   V28   V29   V30   V31   V32   V33   V34   V35   V36
## 1 3.695 3.641 3.589 3.717 3.713 3.698 3.612 3.715 3.917 3.627 3.647 3.618
## 2 3.590 3.571 3.512 3.675 3.652 3.628 3.604 3.834 3.777 3.618 3.652 3.676
## 3 3.654 3.594 3.496 3.625 3.712 3.693 3.643 3.705 3.800 3.721 3.723 3.630
## 4 3.479 3.378 3.410 3.498 3.529 3.440 3.459 3.468 3.625 3.422 3.439 3.516
## 5 3.552 3.420 3.401 3.581 3.581 3.506 3.437 3.633 3.698 3.459 3.521 3.590
## 6 3.548 3.427 3.405 3.617 3.613 3.558 3.495 3.658 3.631 3.546 3.626 3.651
##     V37   V38   V39   V40   V41   V42   V43   V44   V45   V46   V47   V48
## 1 3.708 3.802 3.814 3.894 3.666 3.613 3.630 3.773 3.723 3.803 3.796 3.634
## 2 3.562 3.668 3.748 3.737 3.590 3.557 3.614 3.611 3.596 3.694 3.501 3.469
## 3 3.699 3.756 3.794 3.823 3.553 3.591 3.610 3.662 3.731 3.596 3.631 3.562
## 4 3.440 3.570 3.564 3.568 3.433 3.366 3.436 3.484 3.438 3.363 3.457 3.332
## 5 3.712 3.624 3.653 3.690 3.462 3.435 3.470 3.505 3.442 3.624 3.542 3.353
## 6 3.636 3.599 3.680 3.644 3.353 3.483 3.465 3.483 3.525 3.349 3.437 3.394
##     V49   V50   V51   V52   V53   V54   V55   V56   V57   V58   V59   V60
## 1 3.817 3.811 3.588 3.813 3.872 3.605 3.644 3.886 3.849 3.601 3.603 3.691
## 2 3.794 3.619 3.724 3.878 3.581 3.684 3.711 3.876 3.750 3.589 3.423 3.727
## 3 3.730 3.812 3.578 3.746 3.669 3.544 3.639 3.716 3.767 3.575 3.496 3.583
## 4 3.525 3.561 3.374 3.627 3.474 3.431 3.522 3.680 3.446 3.300 3.290 3.334
## 5 3.550 3.525 3.421 3.709 3.431 3.414 3.460 3.753 3.764 3.475 3.395 3.525
## 6 3.608 3.571 3.465 3.785 3.570 3.441 3.590 3.696 3.674 3.342 3.251 3.493
##     V61   V62   V63   V64   V65   V66   V67   V68   V69   V70   V71   V72
## 1 3.653 3.728 3.508 3.873 3.740 3.696 3.623 3.611 3.667 3.632 3.667 3.700
## 2 3.548 3.695 3.469 3.750 3.667 3.693 3.645 3.692 3.584 3.557 3.563 3.684
## 3 3.584 3.734 3.537 3.807 3.643 3.663 3.606 3.757 3.786 3.752 3.622 3.710
## 4 3.405 3.501 3.362 3.630 3.512 3.501 3.496 3.451 3.446 3.380 3.359 3.408
## 5 3.434 3.646 3.427 3.631 3.450 3.494 3.498 3.505 3.540 3.488 3.444 3.484
## 6 3.489 3.506 3.363 3.711 3.634 3.626 3.592 3.563 3.616 3.557 3.431 3.504
##     V73   V74   V75   V76   V77   V78   V79   V80   V81   V82   V83   V84
## 1 3.686 3.626 3.583 3.615 3.728 3.724 3.816 3.887 3.762 3.707 3.522 3.679
## 2 3.682 3.584 3.513 3.600 3.822 3.685 3.767 3.712 3.656 3.600 3.445 3.621
## 3 3.672 3.637 3.547 3.594 3.700 3.674 3.730 3.745 3.764 3.667 3.514 3.643
## 4 3.319 3.336 3.311 3.351 3.576 3.481 3.454 3.495 3.508 3.336 3.246 3.368
## 5 3.598 3.465 3.456 3.387 3.642 3.590 3.512 3.570 3.582 3.520 3.390 3.397
## 6 3.572 3.520 3.412 3.441 3.694 3.550 3.556 3.477 3.642 3.434 3.422 3.361
##     V85   V86   V87   V88   V89   V90   V91   V92   V93   V94   V95   V96
## 1 3.674 3.696 3.738 4.162 3.688 3.678 3.581 3.594 3.589 3.991 3.805 3.624
## 2 3.721 3.778 3.823 3.942 3.449 3.650 3.583 3.545 3.487 3.809 3.719 3.518
## 3 3.568 3.696 3.599 3.958 3.488 3.644 3.582 3.614 3.637 3.860 3.837 3.608
## 4 3.444 3.525 3.443 3.886 3.830 3.462 3.347 3.293 3.315 3.595 3.496 3.285
## 5 3.495 3.569 3.642 3.936 3.640 3.443 3.415 3.413 3.413 3.763 3.688 3.408
## 6 3.535 3.647 3.487 3.874 3.376 3.504 3.541 3.482 3.444 3.727 3.545 3.393
##     V97   V98   V99  V100  V101  V102  V103  V104  V105  V106  V107  V108
## 1 3.642 3.678 3.706 3.752 3.723 3.821 3.689 3.728 3.827 3.709 3.782 3.694
## 2 3.571 3.681 3.586 3.798 3.661 3.834 3.619 3.562 3.727 3.567 3.651 3.640
## 3 3.634 3.593 3.694 3.762 3.618 3.773 3.613 3.574 3.794 3.625 3.676 3.687
## 4 3.237 3.363 3.461 3.534 3.477 3.587 3.429 3.380 3.602 3.358 3.482 3.411
## 5 3.473 3.497 3.520 3.615 3.481 3.556 3.490 3.484 3.674 3.529 3.512 3.532
## 6 3.453 3.398 3.458 3.621 3.492 3.536 3.482 3.381 3.684 3.400 3.489 3.522
##    V109  V110  V111  V112  V113  V114  V115  V116  V117  V118  V119  V120
## 1 3.655 3.717 3.729 3.701 3.689 3.717 3.566 3.608 3.719 3.739 3.860 3.526
## 2 3.539 3.550 3.561 3.648 3.595 3.586 3.352 3.560 3.810 3.738 3.846 3.519
## 3 3.546 3.757 3.613 3.801 3.598 3.606 3.439 3.672 3.664 3.588 3.661 3.602
## 4 3.294 3.504 3.386 3.383 3.423 3.364 3.137 3.314 3.412 3.623 3.567 3.387
## 5 3.469 3.485 3.486 3.528 3.530 3.531 3.377 3.472 3.638 3.772 3.562 3.418
## 6 3.334 3.592 3.543 3.596 3.466 3.490 3.276 3.448 3.593 3.607 3.552 3.500
##    V121  V122  V123  V124  V125  V126  V127  V128  V129  V130  V131  V132
## 1 3.694 3.784 3.700 3.666 3.785 3.727 3.660 3.600 3.527 3.536 3.682 3.552
## 2 3.645 3.599 3.617 3.609 3.443 3.724 3.557 3.619 3.488 3.487 3.602 3.480
## 3 3.722 3.762 3.514 3.601 3.580 3.634 3.596 3.594 3.415 3.521 3.612 3.465
## 4 3.556 3.491 3.474 3.426 3.423 3.507 3.296 3.398 3.205 3.269 3.321 3.152
## 5 3.571 3.547 3.496 3.456 3.506 3.687 3.483 3.437 3.338 3.350 3.322 3.218
## 6 3.713 3.649 3.502 3.488 3.385 3.760 3.487 3.479 3.306 3.513 3.418 3.325
##    V133  V134  V135  V136  V137  V138  V139  V140  V141  V142  V143  V144
## 1 3.735 3.635 3.600 3.525 3.643 3.722 3.754 3.866 3.651 3.740 3.754 3.686
## 2 3.719 3.518 3.552 3.554 3.499 3.641 3.709 3.949 3.645 3.789 3.705 3.614
## 3 3.656 3.549 3.604 3.544 3.598 3.635 3.850 3.822 3.592 3.801 3.718 3.624
## 4 3.509 3.290 3.345 3.248 3.386 3.484 3.648 3.750 3.375 3.638 3.486 3.481
## 5 3.520 3.409 3.392 3.343 3.358 3.608 3.660 3.899 3.514 3.614 3.639 3.439
## 6 3.635 3.378 3.433 3.377 3.410 3.617 3.759 3.955 3.528 3.756 3.610 3.501
##    V145  V146  V147  V148  V149  V150  V151  V152  V153  V154  V155  V156
## 1 3.633 3.617 3.657 3.711 3.734 3.640 3.630 3.692 3.735 3.588 3.740 3.762
## 2 3.702 3.560 3.674 3.712 3.709 3.539 3.735 3.733 3.633 3.532 3.753 3.608
## 3 3.636 3.676 3.672 3.696 3.758 3.511 3.622 3.706 3.622 3.560 3.721 3.661
## 4 3.423 3.363 3.434 3.522 3.531 3.264 3.330 3.530 3.556 3.355 3.558 3.460
## 5 3.586 3.433 3.482 3.562 3.512 3.413 3.407 3.658 3.567 3.411 3.528 3.519
## 6 3.494 3.507 3.426 3.595 3.599 3.432 3.514 3.674 3.603 3.513 3.602 3.493
##    V157  V158  V159  V160  V161  V162  V163  V164  V165
## 1 3.709 3.672 3.556 3.736 3.752 3.659 3.814 3.674 3.755
## 2 3.577 3.551 3.372 3.712 3.578 3.668 3.613 3.591 3.890
## 3 3.603 3.601 3.488 3.687 3.644 3.578 3.590 3.702 3.707
## 4 3.451 3.487 3.200 3.547 3.399 3.382 3.425 3.488 3.600
## 5 3.553 3.465 3.444 3.488 3.408 3.572 3.428 3.527 3.732
## 6 3.563 3.568 3.356 3.583 3.497 3.472 3.425 3.570 3.726
 head(dutchSpeakersDistMeta)
##      Speaker    Sex AgeYear  AgeGroup ConversationType EduLevel
## 410   N01001 female    1952 age45to55             <NA>     high
## 409   N01002   male    1952 age45to55       maleFemale     high
## 1157  N01003   male    1949 age45to55       maleFemale     high
## 252   N01004 female    1971 age25to34             <NA>     high
## 251   N01005 female    1944   age56up       femaleOnly      mid
## 254   N01006   male    1969 age25to34       maleFemale     high
 dutchSpeakersDist.d=dist(dutchSpeakersDist) 
 dutchSpeakersDist.mds=cmdscale(dutchSpeakersDist.d, k=3) #ruumiline
head(dutchSpeakersDist.mds)
##         [,1]      [,2]        [,3]
## 1 -2.0815243 0.5731975  0.35933471
## 2 -1.1507874 0.4247729  0.22458085
## 3 -1.3908399 0.1544284  0.15167342
## 4  1.2480230 0.8574089 -0.10860655
## 5  0.2988568 0.7163566 -0.04921619
## 6  0.4885506 0.1551359 -0.38153902
p=dutchSpeakersDist.mds
 #install.packages("plot3D")
library(plot3D)
## Warning: package 'plot3D' was built under R version 3.3.3
points3D(p[,1], p[,2], p[,3])

asukohad=cmdscale(dutchSpeakersDist.d, k=2) #tasand
head(asukohad)
##         [,1]      [,2]
## 1 -2.0815243 0.5731975
## 2 -1.1507874 0.4247729
## 3 -1.3908399 0.1544284
## 4  1.2480230 0.8574089
## 5  0.2988568 0.7163566
## 6  0.4885506 0.1551359
plot(asukohad) 

asukohad=cmdscale(dutchSpeakersDist.d, k=1) # joon
head(asukohad)
##         [,1]
## 1 -2.0815243
## 2 -1.1507874
## 3 -1.3908399
## 4  1.2480230
## 5  0.2988568
## 6  0.4885506
plot(asukohad, sample(0, nrow(asukohad), replace = TRUE), col=rgb(0, 0, 0, 0.3)) 

#Paigutage multidimensionaalse skaleerimise abil kahemõõtmelisele joonisele 
#ühe päeva tunnid, nii et sarnasema ilmaga tunnid oleksid lähestikku


ilm=read.table("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt", header=TRUE, sep=",")
ilmtervik=ilm[complete.cases(ilm), ]
ilmskaleeritud=scale(ilmtervik[1:24, 5:11])
ilmskaleeritud
##          RH1H        TA1H       TAN1H      TAX1H        WD1H       WS1H
## 1  -0.8675355  1.82433345  1.94868906  1.7645235  1.45381038  2.0368548
## 2  -0.6940284  1.76249164  1.76111471  1.7645235  1.10489589  0.5925396
## 3  -0.3470142  1.51512439  1.57354036  1.5197341  0.65629154  0.1481349
## 4  -0.3470142  1.32959896  1.32344123  1.3361420  0.80582632  0.5925396
## 5  -0.3470142  1.14407352  1.07334210  1.0913527  0.95536111  0.7036408
## 6  -0.5205213  0.83486446  0.82324297  0.8465633  0.75598140  0.7036408
## 7  -0.6940284  0.64933903  0.63566862  0.6629712  0.40706691  1.0369443
## 8  -0.8675355  0.34012997  0.13547036  0.4181819  0.25753212  2.1479560
## 9  -0.8675355 -0.15460453 -0.30220312 -0.0713969  0.20768720  1.4813490
## 10 -1.2145497 -0.46381359 -0.42725268 -0.4385810  0.50675676  0.9258431
## 11 -1.0410426 -0.21644634 -0.23967833 -0.1937916  0.75598140 -0.8517757
## 12 -1.0410426 -0.03092091  0.01042080 -0.0713969  0.75598140 -0.8517757
## 13 -0.8675355  0.15460453  0.13547036  0.1121951  0.45691183 -0.8517757
## 14 -0.8675355 -0.03092091 -0.05210399  0.1121951  0.15784227 -0.6295733
## 15 -0.3470142 -0.21644634 -0.17715355 -0.2549889 -0.49014179 -0.9628768
## 16  0.6940284 -0.40197178 -0.36472790 -0.3773836 -0.93874613 -1.0739780
## 17  1.2145497 -0.46381359 -0.48977746 -0.5609757 -0.14122729 -0.8517757
## 18  1.3880568 -0.64933903 -0.61482703 -0.6833704 -0.19107222 -0.4073710
## 19  1.2145497 -0.71118084 -0.61482703 -0.8057650 -0.24091715 -0.2962698
## 20  1.0410426 -0.77302265 -0.67735181 -0.8057650  0.05815242 -0.4073710
## 21  1.0410426 -0.95854809 -0.98997572 -0.8669624 -1.13812584 -0.9628768
## 22  1.2145497 -1.26775715 -1.42764920 -1.2341465 -1.98548960 -0.8517757
## 23  1.5615639 -1.57696621 -1.49017399 -1.6013305 -2.18486931 -0.7406745
## 24  1.5615639 -1.63880802 -1.55269877 -1.6625279 -1.98548960 -0.6295733
##         WSX1H
## 1   1.1511143
## 2   0.5494429
## 3   0.5995822
## 4   1.3015321
## 5   1.1009750
## 6   2.0034821
## 7   0.9505572
## 8   1.0508357
## 9   0.6497215
## 10  1.5020893
## 11 -0.7040391
## 12 -0.5034819
## 13 -0.6538998
## 14 -0.2527855
## 15 -0.9045962
## 16 -1.1552926
## 17 -1.0550140
## 18 -0.5034819
## 19 -0.6538998
## 20 -0.5536212
## 21 -0.9547355
## 22 -0.8544569
## 23 -1.2054319
## 24 -0.9045962
## attr(,"scaled:center")
##       RH1H       TA1H      TAN1H      TAX1H       WD1H       WS1H 
##  91.000000   1.450000   1.283333   1.616667 191.833333   3.766667 
##      WSX1H 
##   7.904167 
## attr(,"scaled:scale")
##       RH1H       TA1H      TAN1H      TAX1H       WD1H       WS1H 
##  5.7634531  1.6170289  1.5993658  1.6340578 20.0622221  0.9000805 
##      WSX1H 
##  1.9944443
head(ilm, 24)
##    Kuu Paev  Kell PR1H RH1H TA1H TAN1H TAX1H WD1H WS1H WSX1H
## 1    1    1  0:00    0   86  4.4   4.4   4.5  221  5.6  10.2
## 2    1    1  1:00    0   87  4.3   4.1   4.5  214  4.3   9.0
## 3    1    1  2:00    0   89  3.9   3.8   4.1  205  3.9   9.1
## 4    1    1  3:00    0   89  3.6   3.4   3.8  208  4.3  10.5
## 5    1    1  4:00    0   89  3.3   3.0   3.4  211  4.4  10.1
## 6    1    1  5:00    0   88  2.8   2.6   3.0  207  4.4  11.9
## 7    1    1  6:00    0   87  2.5   2.3   2.7  200  4.7   9.8
## 8    1    1  7:00    0   86  2.0   1.5   2.3  197  5.7  10.0
## 9    1    1  8:00    0   86  1.2   0.8   1.5  196  5.1   9.2
## 10   1    1  9:00    0   84  0.7   0.6   0.9  202  4.6  10.9
## 11   1    1 10:00    0   85  1.1   0.9   1.3  207  3.0   6.5
## 12   1    1 11:00    0   85  1.4   1.3   1.5  207  3.0   6.9
## 13   1    1 12:00    0   86  1.7   1.5   1.8  201  3.0   6.6
## 14   1    1 13:00    0   86  1.4   1.2   1.8  195  3.2   7.4
## 15   1    1 14:00    0   89  1.1   1.0   1.2  182  2.9   6.1
## 16   1    1 15:00    0   95  0.8   0.7   1.0  173  2.8   5.6
## 17   1    1 16:00    0   98  0.7   0.5   0.7  189  3.0   5.8
## 18   1    1 17:00    0   99  0.4   0.3   0.5  188  3.4   6.9
## 19   1    1 18:00    0   98  0.3   0.3   0.3  187  3.5   6.6
## 20   1    1 19:00    0   97  0.2   0.2   0.3  193  3.4   6.8
## 21   1    1 20:00    0   97 -0.1  -0.3   0.2  169  2.9   6.0
## 22   1    1 21:00    0   98 -0.6  -1.0  -0.4  152  3.0   6.2
## 23   1    1 22:00    0  100 -1.1  -1.1  -1.0  148  3.1   5.5
## 24   1    1 23:00    0  100 -1.2  -1.2  -1.1  152  3.2   6.1
asukohad=cmdscale(dist(ilmskaleeritud), 2)
asukohad
##           [,1]         [,2]
## 1  -4.18964099  0.265698338
## 2  -3.20854052 -0.904271336
## 3  -2.51552588 -0.898137111
## 4  -2.72148318 -0.108009576
## 5  -2.46445686  0.001512365
## 6  -2.44900031  0.687953716
## 7  -1.86891879  0.592333181
## 8  -1.83695567  1.715215160
## 9  -0.87605640  1.397116233
## 10 -0.91417413  1.529709791
## 11  0.15286941 -1.058364752
## 12 -0.14750951 -1.095988681
## 13 -0.11987904 -1.209213462
## 14 -0.07158169 -0.684340299
## 15  0.97777326 -0.900227866
## 16  1.83318498 -0.796968971
## 17  1.74488328 -0.639994801
## 18  1.65405993  0.086133627
## 19  1.70900514  0.128383702
## 20  1.58456880  0.049627626
## 21  2.59911851 -0.130742634
## 22  3.36571272  0.481879503
## 23  3.95488341  0.629787764
## 24  3.80766354  0.860908483
plot(asukohad, type="n")
text(asukohad, cex=0.5)

plot(cmdscale(dist(scale(ilmtervik[1:2000, 4:11])), 2))

asukohad=cmdscale(dist(scale(ilmtervik[1:2000, 4:11])), 2)
plot(asukohad, type="n")
text(x=asukohad[, 1], y=asukohad[, 2], labels=ilmtervik[1:2000, "Kuu"])

ryhmad=kmeans(asukohad, centers=3)
plot(asukohad, type="n")
text(x=asukohad[, 1], y=asukohad[, 2], labels=ryhmad$cluster)

plot(asukohad, col=ryhmad$cluster)

head(lexicalMeasures)
##     Word     CelS       Fdif       Vf    Dent    Ient      NsyS     NsyC
## 1    doe 3.912023  1.0216510 1.386294 0.14144 0.02114 0.6931472 0.000000
## 2  whore 4.521789  0.3504830 1.386294 0.42706 0.94198 1.0986123 0.000000
## 3 stress 6.505784  2.0893560 1.609438 0.06197 1.44339 2.4849066 1.945910
## 4   pork 5.017280 -0.5263339 1.945910 0.43035 0.00000 1.0986123 2.639057
## 5   plug 4.890349 -1.0445450 2.197225 0.35920 1.75393 2.4849066 2.484907
## 6   prop 4.770685  0.9248014 1.386294 0.06268 1.74730 1.6094379 1.386294
##   Len Ncou     Bigr     InBi spelV    spelN phonV    phonN friendsV
## 1   3    8 7.036333 12.02268    10 3.737670    41 8.837826        8
## 2   5    5 9.537878 12.59780    20 7.870930    38 9.775825       20
## 3   6    0 9.883931 13.30069    10 6.693324    13 7.040536       10
## 4   4    8 8.309180 12.07807     5 6.677084     6 3.828641        4
## 5   4    3 7.943717 11.92678    17 4.762174    17 4.762174       17
## 6   4    9 8.349620 12.19724    19 6.234411    21 6.249975       19
##   friendsN       ffV      ffN      fbV      fbN ffNonzero    NVratio
## 1 3.295837 0.6931472 2.708050 3.496508 8.833900         1  3.9120230
## 2 7.870930 0.0000000 0.000000 2.944439 9.614738         0  4.9628446
## 3 6.693324 0.0000000 0.000000 1.386294 5.817111         0  0.1773868
## 4 3.526361 0.6931472 6.634633 1.098612 2.564949         1  5.0172798
## 5 4.762174 0.0000000 0.000000 0.000000 0.000000         0  0.3458730
## 6 6.234411 0.0000000 0.000000 1.098612 2.197225         0 -0.8020728
plot(hclust(dist(cor(lexicalMeasures[, -1]))))

ilm=read.table("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt", header=TRUE, sep=",")
ilmtervik=ilm[complete.cases(ilm), ]
ilmskaleeritud=scale(ilmtervik[2000:5000, 4:11])
plot(hclust(dist(cor(ilmskaleeritud))))

jaanuar1=ilmtervik[1:24, 5:11]
plot(hclust(dist(cor(scale(jaanuar1)))))

plot(hclust(dist(cor(scale(t(jaanuar1))))))

jaanuar1
##    RH1H TA1H TAN1H TAX1H WD1H WS1H WSX1H
## 1    86  4.4   4.4   4.5  221  5.6  10.2
## 2    87  4.3   4.1   4.5  214  4.3   9.0
## 3    89  3.9   3.8   4.1  205  3.9   9.1
## 4    89  3.6   3.4   3.8  208  4.3  10.5
## 5    89  3.3   3.0   3.4  211  4.4  10.1
## 6    88  2.8   2.6   3.0  207  4.4  11.9
## 7    87  2.5   2.3   2.7  200  4.7   9.8
## 8    86  2.0   1.5   2.3  197  5.7  10.0
## 9    86  1.2   0.8   1.5  196  5.1   9.2
## 10   84  0.7   0.6   0.9  202  4.6  10.9
## 11   85  1.1   0.9   1.3  207  3.0   6.5
## 12   85  1.4   1.3   1.5  207  3.0   6.9
## 13   86  1.7   1.5   1.8  201  3.0   6.6
## 14   86  1.4   1.2   1.8  195  3.2   7.4
## 15   89  1.1   1.0   1.2  182  2.9   6.1
## 16   95  0.8   0.7   1.0  173  2.8   5.6
## 17   98  0.7   0.5   0.7  189  3.0   5.8
## 18   99  0.4   0.3   0.5  188  3.4   6.9
## 19   98  0.3   0.3   0.3  187  3.5   6.6
## 20   97  0.2   0.2   0.3  193  3.4   6.8
## 21   97 -0.1  -0.3   0.2  169  2.9   6.0
## 22   98 -0.6  -1.0  -0.4  152  3.0   6.2
## 23  100 -1.1  -1.1  -1.0  148  3.1   5.5
## 24  100 -1.2  -1.2  -1.1  152  3.2   6.1
t(jaanuar1)
##           1     2     3     4     5     6     7     8     9    10    11
## RH1H   86.0  87.0  89.0  89.0  89.0  88.0  87.0  86.0  86.0  84.0  85.0
## TA1H    4.4   4.3   3.9   3.6   3.3   2.8   2.5   2.0   1.2   0.7   1.1
## TAN1H   4.4   4.1   3.8   3.4   3.0   2.6   2.3   1.5   0.8   0.6   0.9
## TAX1H   4.5   4.5   4.1   3.8   3.4   3.0   2.7   2.3   1.5   0.9   1.3
## WD1H  221.0 214.0 205.0 208.0 211.0 207.0 200.0 197.0 196.0 202.0 207.0
## WS1H    5.6   4.3   3.9   4.3   4.4   4.4   4.7   5.7   5.1   4.6   3.0
## WSX1H  10.2   9.0   9.1  10.5  10.1  11.9   9.8  10.0   9.2  10.9   6.5
##          12    13    14    15    16    17    18    19    20    21    22
## RH1H   85.0  86.0  86.0  89.0  95.0  98.0  99.0  98.0  97.0  97.0  98.0
## TA1H    1.4   1.7   1.4   1.1   0.8   0.7   0.4   0.3   0.2  -0.1  -0.6
## TAN1H   1.3   1.5   1.2   1.0   0.7   0.5   0.3   0.3   0.2  -0.3  -1.0
## TAX1H   1.5   1.8   1.8   1.2   1.0   0.7   0.5   0.3   0.3   0.2  -0.4
## WD1H  207.0 201.0 195.0 182.0 173.0 189.0 188.0 187.0 193.0 169.0 152.0
## WS1H    3.0   3.0   3.2   2.9   2.8   3.0   3.4   3.5   3.4   2.9   3.0
## WSX1H   6.9   6.6   7.4   6.1   5.6   5.8   6.9   6.6   6.8   6.0   6.2
##          23    24
## RH1H  100.0 100.0
## TA1H   -1.1  -1.2
## TAN1H  -1.1  -1.2
## TAX1H  -1.0  -1.1
## WD1H  148.0 152.0
## WS1H    3.1   3.2
## WSX1H   5.5   6.1
ilmskaleeritud=scale(ilmtervik[ilmtervik$Kuu==1 & ilmtervik$Kell=="10:00", 4:11])
plot(hclust(dist(cor(ilmskaleeritud))))

row.names(ilmskaleeritud)=1:31
plot(hclust(dist(cor(t(ilmskaleeritud)))))

ryhmad=cutree(hclust(dist(cor(t(ilmskaleeritud)))), k=3) #joon kolme haru kohalt
plot(ilmskaleeritud[, c("TA1H", "WS1H")], type="n") #teljed
text(ilmskaleeritud[, c("TA1H", "WS1H")], 
     labels = row.names(ilmskaleeritud),  col=ryhmad)