#Importar datos

EmojisFood <- read.csv("C:/Users/Solutian/Desktop/Visualizacion/Endogramas/Endogramas/EmojisFood.csv-20210612T004456Z-001/EmojisFood.csv")

head(EmojisFood)
##         name emoji Calories..kcal. Carbohydrates..g. Total.Sugar..g.
## 1     grapes  ðŸ\215‡            0.69            0.1810          0.1548
## 2      melon  ðŸ\215\210            0.28            0.0658          0.0569
## 3 watermelon  ðŸ\215‰            0.30            0.0755          0.0620
## 4  tangerine  ðŸ\215Š            0.53            0.1334          0.1058
## 5      lemon  ðŸ\215‹            0.29            0.0932          0.0250
## 6     banana  ðŸ\215Œ            0.89            0.2284          0.1223
##   Protein..g. Total.Fat..g. Saturated.Fat..g. Monounsaturated.Fat..g.
## 1      0.0072        0.0016           0.00054                 0.00007
## 2      0.0111        0.0010           0.00025                 0.00002
## 3      0.0061        0.0015           0.00016                 0.00037
## 4      0.0081        0.0031           0.00039                 0.00060
## 5      0.0110        0.0030           0.00039                 0.00011
## 6      0.0109        0.0033           0.00112                 0.00032
##   Polyunsaturated.Fat..g. Total.Fiber..g. Cholesterol..mg. Vitamin.B6..mg.
## 1                 0.00048           0.009                0         0.00086
## 2                 0.00039           0.009                0         0.00163
## 3                 0.00050           0.004                0         0.00045
## 4                 0.00065           0.018                0         0.00078
## 5                 0.00089           0.028                0         0.00080
## 6                 0.00073           0.026                0         0.00367
##   Vitamin.A..IU. Vitamin.B12..ug. Vitamin.C..mg. Vitamin.D..IU. Vitamin.E..IU.
## 1           0.66                0          0.032              0         0.0019
## 2           0.00                0          0.218              0         0.0005
## 3           5.69                0          0.081              0         0.0005
## 4           6.81                0          0.267              0         0.0020
## 5           0.22                0          0.530              0         0.0015
## 6           0.64                0          0.087              0         0.0010
##   Vitamin.K..ug. Thiamin..mg. Riboflavin..mg. Niacin..mg. Folate..ug.
## 1          0.146      0.00069         0.00070     0.00188        0.02
## 2          0.025      0.00015         0.00031     0.00232        0.08
## 3          0.001      0.00033         0.00021     0.00178        0.03
## 4          0.000      0.00058         0.00036     0.00376        0.16
## 5          0.000      0.00040         0.00020     0.00100        0.11
## 6          0.005      0.00031         0.00073     0.00665        0.20
##   Pantothenic.Acid..mg. Choline..mg. Calcium..g. Copper..mg. Iron..mg.
## 1               0.00050        0.056        0.10     0.00127    0.0036
## 2               0.00084        0.076        0.11     0.00060    0.0034
## 3               0.00221        0.041        0.07     0.00042    0.0024
## 4               0.00216        0.102        0.37     0.00042    0.0015
## 5               0.00190        0.051        0.26     0.00037    0.0060
## 6               0.00334        0.098        0.05     0.00078    0.0026
##   Magnesium..mg. Manganese..mg. Phosphorus..g. Potassium..g. Selenium..ug.
## 1           0.07        0.00071           0.20          1.91         0.001
## 2           0.11        0.00035           0.05          1.82         0.004
## 3           0.10        0.00038           0.11          1.12         0.004
## 4           0.12        0.00039           0.20          1.66         0.001
## 5           0.08        0.00030           0.16          1.38         0.004
## 6           0.27        0.00270           0.22          3.58         0.010
##   Sodium..g. Zinc..mg.
## 1       0.02    0.0007
## 2       0.09    0.0007
## 3       0.01    0.0010
## 4       0.02    0.0007
## 5       0.02    0.0006
## 6       0.01    0.0015
#Normalizado
emojiNorm <- scale(EmojisFood[,3:35])

#asignación de nombres
rownames(emojiNorm)<-EmojisFood$name

#Distancias
emojiDistancias<-dist(emojiNorm)

emojiDistancias
##                   grapes      melon watermelon  tangerine      lemon     banana
## melon          2.2493210                                                       
## watermelon     2.4932573  1.2481429                                            
## tangerine      2.5502158  1.1400726  1.3110562                                 
## lemon          3.3321002  1.8029965  2.2371753  1.4452700                      
## banana         3.3416139  2.5189536  3.2445225  2.6760226  3.3594592           
## pineapple      3.2235188  2.1146587  2.4086646  1.8900884  1.9061468  3.2999879
## red apple      2.3324226  1.6092753  1.1743379  1.4361830  2.3819979  3.1222276
## green apple    2.1910471  1.6999841  1.4406386  1.5429230  2.3431430  3.1287930
## pear           2.0813844  1.7471560  1.6306390  1.5542124  2.2592445  3.1453223
## peach          2.0835742  1.3530579  1.1384799  1.2586780  2.2422859  2.9287327
## cherries       2.0609888  1.3737225  1.3604958  1.1353934  2.1799386  2.5258622
## strawberry     3.2400044  1.9374843  2.3977581  1.6446578  1.0053505  3.5096247
## kiwifruit      5.5232190  6.4780851  7.1237935  6.5906737  6.2935742  7.0824259
## tomato         1.7874640  1.2759865  1.6922879  1.6528563  2.3250412  2.8813176
## avocado        6.1926510  6.6091393  7.0595017  6.4888220  6.6919994  5.6184614
## eggplant       2.3673851  1.6551991  1.8249315  1.5783115  2.3386153  2.4296883
## potato         7.1449327  6.9181529  7.0824920  6.6888645  7.0800538  6.2219276
## carrot         5.4130324  5.6073054  5.7028806  5.4937667  5.9603134  5.7101950
## corn           3.4452791  2.7557755  2.7812085  2.3904640  3.1421035  2.5665050
## hot pepper     6.5254739  5.9073190  6.9001835  6.0890476  5.4013040  6.0109781
## cucumber       1.5604104  2.3766655  2.4061398  2.7851921  3.3463690  3.9008226
## mushroom       6.1053774  5.9810348  5.9643479  5.8597058  6.3359657  5.6180036
## peanuts       19.2249920 19.3170085 19.5496177 19.0632856 19.2556864 18.2538185
## chestnut       5.0275919  4.5035213  5.1068337  4.6150758  4.8798137  3.6040698
## bread          7.7659537  7.9447778  8.0018992  7.6499917  7.8979448  7.4306141
## croissant      7.3211080  7.4487540  7.3931487  7.0605541  7.4715483  7.1486653
## french bread   9.1192809  9.2992468  9.3210445  9.0353146  9.3077213  8.9422026
## pancakes       5.7522788  5.6662303  5.5478156  5.4913343  5.9130385  5.9090657
## cheese        14.0895049 14.0447252 14.0036355 13.8925664 14.1333827 14.1548921
## beef          11.1878638 10.8665693 11.2555432 11.1287872 11.3204254 10.3175676
## chicken        8.8147715  8.5471364  8.7428756  8.6238809  8.9791200  8.1339338
## bacon         12.6959603 12.5876726 12.4721531 12.5580985 12.7369797 12.9552928
## hamburger      5.9520995  5.7643940  5.7825956  5.7418237  6.0909827  5.8340962
## french fries   5.7630875  5.9268844  6.4837726  5.9062919  6.3309070  4.5812983
## pizza          6.7211536  6.9402839  7.0522038  6.7195701  7.0525263  6.8571916
## hotdog         6.9864856  6.8770727  6.7967700  6.8048949  7.1142320  7.0256521
## taco           5.0818682  5.4702716  5.7201084  5.4557188  5.7356121  5.5750995
## burrito        4.7724949  4.8981373  5.0702646  4.6763475  5.0456752  4.7111042
## popcorn       10.2978119 10.2637044 10.4338681 10.0414443 10.0570043  9.4735579
## rice crackers 12.1815078 12.1965659 12.2898422 12.0699279 12.4795924 11.0461579
## rice           3.7083506  3.1902430  2.7742022  3.0079074  3.5432913  4.0752596
## spaghetti      4.7455240  4.5408507  4.3975409  4.3200288  4.7104306  4.9437789
## fried shrimp   6.6614678  6.6154474  6.6246313  6.5267083  6.9058827  7.0145288
## ice cream      8.7124540  8.6949105  8.6244123  8.5395090  8.9304240  8.8130318
## doughnut       5.5761993  6.1597616  6.1674637  5.8433138  6.3586631  6.0914086
## cookie         6.0721527  6.2462720  6.1992827  6.0769955  6.5316091  6.1279934
## cake           7.5938285  7.5605348  7.6203206  7.3232159  7.7826500  7.4606065
## chocolate bar  6.5061575  7.1059860  7.0652146  6.7283220  7.4284201  6.6939312
## candy          5.7218042  6.1778949  5.8863096  5.7920670  6.5449217  6.3986838
## custard flan   4.3859155  4.3311358  4.0715815  4.1215247  4.8221084  4.7711807
## honey          5.9321926  6.4403367  6.2121301  6.0479110  6.8515738  6.5183527
## milk           3.2460079  2.5717380  2.2356567  2.5530378  3.2967834  3.7180611
## black tea      3.0361221  2.0240503  1.1964418  2.2554042  2.8735013  4.1073788
## sake           3.0322488  2.1150496  1.2935518  2.2828225  2.9123856  4.1309761
## champagne      2.8136834  1.6915409  0.9293583  2.0008823  2.7151961  3.6728101
## red wine       2.6305709  1.4737542  0.9252174  1.8699342  2.6570141  3.3839880
## beer           2.9375706  1.8348155  1.0922834  2.0648974  2.7994810  3.8657413
##                pineapple  red apple green apple       pear      peach
## melon                                                                
## watermelon                                                           
## tangerine                                                            
## lemon                                                                
## banana                                                               
## pineapple                                                            
## red apple      2.6803390                                             
## green apple    2.7431519  0.5086656                                  
## pear           2.6492621  0.8347397   0.4696702                      
## peach          2.5244055  1.1185123   1.1351443  1.2353686           
## cherries       2.4841000  1.0478284   1.0466467  1.1095920  0.8975494
## strawberry     1.4308440  2.6342578   2.6105900  2.4897709  2.3258419
## kiwifruit      6.4786156  7.0864363   6.8021152  6.5538861  6.5954377
## tomato         2.5818592  1.8832215   1.7437042  1.7377489  1.1564409
## avocado        6.8871515  6.9225323   6.6393840  6.4795180  6.3837015
## eggplant       2.6030412  1.6368637   1.4106163  1.3852899  1.2363075
## potato         7.0365962  7.2530603   7.1805106  7.1690395  6.8509391
## carrot         6.0822195  5.7575919   5.6083993  5.5972692  5.4293560
## corn           3.2161027  2.9331864   2.9117292  2.9052834  2.5829067
## hot pepper     5.5311526  7.1824731   7.1114618  6.9487969  6.7321272
## cucumber       3.4298528  2.6035447   2.4137891  2.3740988  2.2682785
## mushroom       6.2236702  6.2948465   6.2886949  6.2460216  5.8076707
## peanuts       18.9258808 19.5905230  19.4846465 19.3177808 18.9847448
## chestnut       4.5153646  5.4090972   5.4500363  5.3137180  4.9223968
## bread          7.5779875  8.0049118   7.9139341  7.8193430  7.7650772
## croissant      7.3074955  7.3835674   7.3648687  7.3176111  7.2328698
## french bread   9.0211661  9.3819268   9.3531928  9.3009394  9.1992241
## pancakes       5.8543491  5.7227092   5.7797668  5.7945036  5.5752585
## cheese        14.2097443 14.0879437  14.1159460 14.1019427 13.9729220
## beef          11.3039316 11.4368328  11.4452251 11.4420141 11.1416219
## chicken        8.9390949  9.0228876   9.0188606  9.0254897  8.6320134
## bacon         12.7490088 12.4638762  12.5062265 12.5263848 12.5286496
## hamburger      5.9874589  5.9944324   6.0246064  6.0210918  5.7111899
## french fries   6.3741693  6.3597534   6.2145657  6.1371758  5.8426707
## pizza          6.9452630  7.0246686   6.9578673  6.8824190  6.7672152
## hotdog         7.0508306  7.0176468   7.0413502  7.0445366  6.7699920
## taco           5.8907429  5.5207232   5.3295146  5.1990525  5.2662393
## burrito        5.0915576  4.9780768   4.8471767  4.7489935  4.7185088
## popcorn       10.1013177 10.1428771  10.0097637  9.8772641 10.1171936
## rice crackers 11.3432304 12.4802270  12.4972619 12.4473105 12.1774369
## rice           3.2573106  3.0802437   3.1776159  3.2217530  3.0472729
## spaghetti      4.5365085  4.4220771   4.4253330  4.3975944  4.4157395
## fried shrimp   6.9058239  6.6011796   6.6128424  6.5835729  6.3852262
## ice cream      8.9208523  8.6189629   8.6708496  8.6893689  8.5674090
## doughnut       6.1341104  5.9352176   5.9238069  5.7727877  5.9271811
## cookie         6.2189045  6.2366860   6.2917706  6.2035238  6.0834453
## cake           7.6723671  7.6243224   7.6401004  7.5331405  7.4867823
## chocolate bar  7.1352263  6.8838496   6.9523374  6.8734509  6.8329631
## candy          6.1779069  5.4287670   5.6686192  5.6841939  5.9120433
## custard flan   4.7332013  4.1301731   4.2786434  4.3493355  4.1322205
## honey          6.4149358  5.7562265   5.9918005  6.0043046  6.1740814
## milk           3.4716258  2.6238844   2.7618446  2.9039923  2.4687791
## black tea      2.9086719  1.6633702   1.8858763  2.1083868  1.8981266
## sake           3.1064122  1.6272472   1.8768455  2.0994558  1.9717018
## champagne      2.8251751  1.4649528   1.7241904  1.9740194  1.6656632
## red wine       2.7802681  1.4820392   1.7049718  1.9353132  1.4670624
## beer           2.9551361  1.5743919   1.8286104  2.0445639  1.8139460
##                 cherries strawberry  kiwifruit     tomato    avocado   eggplant
## melon                                                                          
## watermelon                                                                     
## tangerine                                                                      
## lemon                                                                          
## banana                                                                         
## pineapple                                                                      
## red apple                                                                      
## green apple                                                                    
## pear                                                                           
## peach                                                                          
## cherries                                                                       
## strawberry     2.3750316                                                       
## kiwifruit      6.6619977  5.9083861                                            
## tomato         1.4988724  2.2304294  5.8444989                                 
## avocado        6.3247638  6.6718928  6.4613756  6.0331685                      
## eggplant       1.1868273  2.4740886  6.5490632  1.3588083  5.6621217           
## potato         6.7807075  7.1346718  8.9969962  6.6754607  7.3944575  6.6385658
## carrot         5.4994423  5.9501903  7.3593807  5.0634266  7.0106790  5.3469704
## corn           2.4178426  3.3195388  7.1981885  2.8228074  5.4440272  2.1857132
## hot pepper     6.6929363  5.1634662  5.3873296  6.1396154  7.5128969  6.6604536
## cucumber       2.4695056  3.2329082  5.4996534  1.6793770  6.2128149  2.4032102
## mushroom       5.8189692  6.4086461  8.9776497  5.9940219  6.4512467  5.5688498
## peanuts       19.1022899 19.0731929 19.3052590 18.9662141 15.5034096 18.5909644
## chestnut       4.7121541  4.7735664  7.4162592  4.6818845  6.2712981  4.6623452
## bread          7.6696509  7.8774584  9.8117063  7.8406955  7.7000620  7.4194675
## croissant      7.1494795  7.5046071  9.7076031  7.4067444  7.4339111  7.0693806
## french bread   9.1401307  9.3102775 11.3285383  9.2748272  9.5425007  8.9774501
## pancakes       5.5506530  5.9666535  8.9460313  5.7328906  7.7208701  5.6072239
## cheese        13.9985914 14.1496783 15.4739019 14.0207769 14.5796230 14.0001492
## beef          11.1667614 11.4059665 12.9979589 11.0447841 11.2992479 11.0144608
## chicken        8.6842605  9.0380592 10.8008066  8.6000469  8.7916662  8.4880541
## bacon         12.5519326 12.7560211 14.4688513 12.6541037 13.0495508 12.6814753
## hamburger      5.7333803  6.0962192  8.9800078  5.7892533  7.5376407  5.7047059
## french fries   5.7206690  6.3336409  7.2974114  5.5746500  4.3746598  5.4166542
## pizza          6.7888824  6.9909067  8.8990040  6.7244440  7.6012777  6.6064990
## hotdog         6.8271285  7.1415014  9.7838311  6.9012483  8.1584417  6.7714698
## taco           5.2694911  5.6978557  7.0045888  5.0819762  6.2381733  5.0664868
## burrito        4.6289060  5.1155454  7.5896157  4.7339907  5.8687909  4.3752272
## popcorn        9.8842332 10.1654383 11.8118966 10.2373084  9.3432037  9.7030013
## rice crackers 12.1196081 12.1553709 13.6034527 12.1546243 11.4963690 11.8453989
## rice           3.1271490  3.5579059  7.7606357  3.3050067  7.0099749  3.1119595
## spaghetti      4.4263616  4.7372799  8.2644072  4.5985733  7.3338689  4.3023545
## fried shrimp   6.5890917  6.8339693  8.9307360  6.4639536  8.0174608  6.5556969
## ice cream      8.5256370  8.9615654 10.9718323  8.7402303 10.1828263  8.6735479
## doughnut       5.6813537  6.2987691  8.0570318  6.1036587  7.0448045  5.9647217
## cookie         5.9723529  6.4851529  9.1213212  6.2809723  7.4907836  6.1405996
## cake           7.3949475  7.8130014 10.1116334  7.6545684  8.7081130  7.4532498
## chocolate bar  6.5445717  7.3999095  9.1482721  7.1636058  7.8486080  6.9926348
## candy          5.5826358  6.5573536  9.2964644  6.5227543  9.7330807  6.4999468
## custard flan   4.0502383  4.8826351  8.2193553  4.5370110  7.4972716  4.4207993
## honey          5.8179868  6.8214702  9.4287422  6.7837731  9.7684021  6.7298955
## milk           2.5770839  3.4198918  7.5476383  2.7387580  6.9568414  2.7279872
## black tea      2.2603631  2.9276512  7.5745811  2.2870472  7.7679532  2.4769329
## sake           2.2606498  3.0562645  7.5906192  2.4341348  7.7972082  2.6390385
## champagne      1.9510529  2.8326393  7.4674151  2.0641930  7.5024299  2.2641367
## red wine       1.7305052  2.7505195  7.3281912  1.8017362  7.2738781  2.0441729
## beer           2.1682392  2.9363799  7.5426662  2.2271658  7.6025116  2.4067170
##                   potato     carrot       corn hot pepper   cucumber   mushroom
## melon                                                                          
## watermelon                                                                     
## tangerine                                                                      
## lemon                                                                          
## banana                                                                         
## pineapple                                                                      
## red apple                                                                      
## green apple                                                                    
## pear                                                                           
## peach                                                                          
## cherries                                                                       
## strawberry                                                                     
## kiwifruit                                                                      
## tomato                                                                         
## avocado                                                                        
## eggplant                                                                       
## potato                                                                         
## carrot         3.1263024                                                       
## corn           6.3544743  5.7208204                                            
## hot pepper     8.1293662  7.7853991  6.7258775                                 
## cucumber       7.3705235  5.4541251  3.4760724  6.7344167                      
## mushroom       7.5386846  7.6596162  4.8464568  8.3354641  6.2189223           
## peanuts       18.1217895 19.1131772 17.7656028 18.8834853 19.5290536 17.5731339
## chestnut       6.7838315  6.9057483  4.3969925  5.7628831  5.5736353  6.2113393
## bread          9.0156321  8.9208293  6.5852077  9.4553613  8.0542317  7.0613092
## croissant      8.8827837  8.5795754  6.1737759  9.4733166  7.6438032  7.0670874
## french bread  10.4007870 10.2687770  8.3197543 10.6417149  9.5280626  8.1886077
## pancakes       8.2787138  7.6021872  5.2223027  8.4973882  5.9307972  6.0040284
## cheese        15.0694007 14.7404743 13.5762574 15.3187663 14.0373536 13.8227393
## beef          11.8286274 11.9655077 10.1203185 11.3624310 11.3336537 10.2067249
## chicken        9.7224049  9.7669438  7.3086558  9.8323076  8.7715377  7.2996391
## bacon         14.5678497 13.8516923 12.6491162 14.4897503 12.7408126 13.9747688
## hamburger      8.2541511  7.6745326  5.2049028  8.3013323  6.1515955  6.3025091
## french fries   7.0294512  6.8888184  4.7440283  7.1773988  6.1801217  6.9281603
## pizza          8.8326907  8.0791319  6.1798581  8.8142198  7.0327234  7.4285332
## hotdog         9.0519836  8.5070707  6.2540556  9.2217547  7.1051315  6.4743413
## taco           8.0935746  6.8356224  4.9498205  7.8565299  5.1569745  7.1085825
## burrito        7.3035936  6.5388239  3.8930828  7.5218155  5.0604485  5.2468276
## popcorn       10.8952486 10.9728597  9.1834864 11.4731639 10.6045982 10.7263222
## rice crackers 11.9048061 12.8413521 10.6816940 12.6113355 12.3541296 11.3170295
## rice           7.5122063  6.3962676  3.0319273  7.4624184  3.6523121  6.0209802
## spaghetti      8.0015381  6.9921261  4.3086877  7.9616281  4.9737809  6.1289223
## fried shrimp   9.2711061  8.2105629  6.2859979  9.1355153  6.7732729  8.4150151
## ice cream     10.6156252 10.0557858  8.4918775 10.9031198  8.8958098  8.0438253
## doughnut       8.5569253  7.7557180  5.5034287  8.6286693  6.1352633  7.7460730
## cookie         8.5096576  8.0868131  5.7034353  8.8081233  6.6132010  6.9900717
## cake           9.4271729  9.0868950  6.3508368  9.7855807  7.8909462  7.8539995
## chocolate bar  8.8854105  8.5787314  6.3241684  9.3819022  7.2928871  7.5372775
## candy          9.4567150  8.5043962  6.4613373  9.5252530  6.6965273  9.0383533
## custard flan   7.8260053  6.9372809  4.3451693  8.0337949  4.7172482  5.7282199
## honey          9.5110575  8.6534352  6.7079820  9.5887217  6.9919600  8.9948264
## milk           7.2439695  6.0481119  3.1422217  7.2879260  3.1030399  5.2621440
## black tea      7.8218161  6.2038529  3.6745951  7.5655773  2.6744240  6.5960860
## sake           7.8611429  6.2564069  3.6530952  7.6073723  2.7755178  6.7081141
## champagne      7.5668005  6.0520817  3.3198562  7.3104152  2.5559168  6.4143400
## red wine       7.3623930  5.9028212  3.0730850  7.1367531  2.4383365  6.1852322
## beer           7.7034531  6.1325093  3.3058119  7.3990227  2.6378139  6.3752337
##                  peanuts   chestnut      bread  croissant french bread
## melon                                                                 
## watermelon                                                            
## tangerine                                                             
## lemon                                                                 
## banana                                                                
## pineapple                                                             
## red apple                                                             
## green apple                                                           
## pear                                                                  
## peach                                                                 
## cherries                                                              
## strawberry                                                            
## kiwifruit                                                             
## tomato                                                                
## avocado                                                               
## eggplant                                                              
## potato                                                                
## carrot                                                                
## corn                                                                  
## hot pepper                                                            
## cucumber                                                              
## mushroom                                                              
## peanuts                                                               
## chestnut      17.0036017                                              
## bread         15.3536934  7.4969017                                   
## croissant     16.1828473  7.4712580  4.5131017                        
## french bread  16.1121647  8.7112316  3.3693261  5.3580244             
## pancakes      17.6428278  6.4756371  5.2353394  4.4856850    6.1453308
## cheese        20.1896584 14.5082178 13.2076869 12.2186708   14.1796114
## beef          17.4600630 10.6968361  9.5863926  9.4973931   10.5457841
## chicken       16.9898468  8.7624327  7.9169802  6.9538506    9.4397140
## bacon         19.9065748 13.3415508 14.1113426 11.2607708   15.0278810
## hamburger     16.8251397  6.0248909  4.6941736  4.5400379    5.7350781
## french fries  15.3568325  4.9109133  6.9666566  6.6890699    8.7622458
## pizza         15.9517062  7.0048159  3.5813563  4.0816053    4.4944116
## hotdog        17.1674597  7.3381864  4.7527466  4.0920019    5.3545856
## taco          17.0899168  6.6602765  6.4423074  5.8645336    8.3186525
## burrito       16.7418762  5.7198096  4.2402349  4.1922800    5.7899123
## popcorn       14.9291511  9.7775228  7.8896209  8.5394203    9.4336456
## rice crackers 15.0487627 10.5170103  9.2481077 10.5256154   10.7895513
## rice          18.3586310  4.9491847  6.1229660  6.0217891    7.4297214
## spaghetti     17.8672628  5.6975499  4.8310429  5.0760430    5.7887099
## fried shrimp  17.2995229  7.6722353  7.3720666  5.4872650    8.6101388
## ice cream     19.8988104  9.6757708 10.5732169  9.0238284   11.5411640
## doughnut      16.9327741  6.5683592  6.4288723  5.0665922    8.2078804
## cookie        16.4446179  5.5613395  6.0457976  5.1217604    6.8498809
## cake          17.3234317  7.9786300  7.2326582  5.4075274    8.4877704
## chocolate bar 17.4191748  7.1706899  7.6440178  5.5941018    8.9084131
## candy         20.6262176  7.4513015  9.2409947  8.3570070   10.3247237
## custard flan  19.1314435  6.2473823  7.4361909  5.7959207    8.5714372
## honey         20.5502195  7.7689696  9.4357788  8.6219723   10.5136792
## milk          19.2347168  5.4464866  7.5617241  6.7306671    8.7585812
## black tea     20.1434445  5.9398025  8.5425194  7.9346124    9.7729937
## sake          20.0986977  5.8712303  8.4340414  7.7376229    9.6819251
## champagne     19.8612666  5.5437529  8.2599993  7.6709813    9.5366071
## red wine      19.6436120  5.2784874  8.0751358  7.5185041    9.3721164
## beer          19.9487165  5.7798290  8.2984655  7.6282650    9.5469248
##                 pancakes     cheese       beef    chicken      bacon  hamburger
## melon                                                                          
## watermelon                                                                     
## tangerine                                                                      
## lemon                                                                          
## banana                                                                         
## pineapple                                                                      
## red apple                                                                      
## green apple                                                                    
## pear                                                                           
## peach                                                                          
## cherries                                                                       
## strawberry                                                                     
## kiwifruit                                                                      
## tomato                                                                         
## avocado                                                                        
## eggplant                                                                       
## potato                                                                         
## carrot                                                                         
## corn                                                                           
## hot pepper                                                                     
## cucumber                                                                       
## mushroom                                                                       
## peanuts                                                                        
## chestnut                                                                       
## bread                                                                          
## croissant                                                                      
## french bread                                                                   
## pancakes                                                                       
## cheese        11.2010116                                                       
## beef           9.4906137 11.0802682                                            
## chicken        7.0704496 11.7566721  5.8536192                                 
## bacon         11.7676960 15.2316107 15.0986223 13.3760045                      
## hamburger      3.1900545 11.2154591  7.7984426  6.6287743 11.8681140           
## french fries   6.5723196 14.0563227 10.0797424  7.8340792 12.2998892  6.1956632
## pizza          3.9142400 11.3707982  8.9758370  7.6364506 12.8178046  3.2191068
## hotdog         3.4136892 11.5237604  8.2443196  6.6654764 11.8814287  2.1231898
## taco           5.0822076 11.1636999  8.6020411  7.0288726 11.7828948  4.3468403
## burrito        3.4394362 12.1638143  9.0244180  6.9218390 12.4493099  3.3342664
## popcorn        8.4052258 14.2572259 11.9263248 10.9916613 12.9689166  8.0656003
## rice crackers 11.0860610 15.5898703 12.3996068 10.8500397 16.8037857 10.5864698
## rice           4.7555836 13.7905612 10.6526320  8.3159239 12.5355023  4.6125823
## spaghetti      4.2284097 13.2619269 10.1655861  8.0865250 12.8117111  3.9623239
## fried shrimp   5.4399342 12.1918181  9.9507191  7.7184351 11.1251495  5.2335427
## ice cream      8.4484012 13.4794385 11.6607658  9.1769730 13.1323491  8.9762066
## doughnut       4.8774137 11.9960756 10.4385657  8.1560480 10.6937306  5.4401517
## cookie         4.7180249 13.0852019 10.7569034  9.0265219 10.2807479  4.4565026
## cake           6.3647840 13.0172272  9.6639369  7.1874487 12.0358925  6.6652690
## chocolate bar  6.3660374 12.0347212 10.8919700  8.9432364 10.6577745  6.4528696
## candy          7.6670407 15.2059259 13.0668528 11.0254920 13.1923186  7.9248373
## custard flan   3.8659409 11.9594269  9.9119331  7.0003720 11.8713869  5.0120284
## honey          7.9983162 15.2914807 12.9978668 11.0381308 13.5784370  8.2114263
## milk           4.2637627 12.2391349 10.3693849  7.9641276 12.1040604  4.8859650
## black tea      5.9291505 14.2063369 11.7078897  9.2752461 12.5048176  6.2264645
## sake           5.7871111 14.0455462 11.6061892  9.1847453 12.2198358  6.0564002
## champagne      5.6420484 13.9813610 11.3412534  8.9705643 12.3367425  5.8836614
## red wine       5.5039637 13.9262534 11.1030547  8.7515700 12.3568486  5.7036059
## beer           5.7193619 14.0122828 11.3097437  8.8527300 12.4047914  5.9964177
##               french fries      pizza     hotdog       taco    burrito
## melon                                                                 
## watermelon                                                            
## tangerine                                                             
## lemon                                                                 
## banana                                                                
## pineapple                                                             
## red apple                                                             
## green apple                                                           
## pear                                                                  
## peach                                                                 
## cherries                                                              
## strawberry                                                            
## kiwifruit                                                             
## tomato                                                                
## avocado                                                               
## eggplant                                                              
## potato                                                                
## carrot                                                                
## corn                                                                  
## hot pepper                                                            
## cucumber                                                              
## mushroom                                                              
## peanuts                                                               
## chestnut                                                              
## bread                                                                 
## croissant                                                             
## french bread                                                          
## pancakes                                                              
## cheese                                                                
## beef                                                                  
## chicken                                                               
## bacon                                                                 
## hamburger                                                             
## french fries                                                          
## pizza            6.3315863                                            
## hotdog           7.2935193  3.7248664                                 
## taco             5.1094981  4.6091906  5.4186061                      
## burrito          4.9463408  3.1630920  4.0012144  3.2890889           
## popcorn          7.8145867  7.8889972  8.4954224  7.5685577  7.5221051
## rice crackers   10.1223091 10.5049062 11.0881713 11.1200699 10.5644340
## rice             6.3675560  5.6136384  5.6680768  5.5890751  4.3458486
## spaghetti        6.6722592  4.3579283  4.6201220  5.4828331  3.7073403
## fried shrimp     6.4705816  5.2572481  5.5075516  4.4802320  4.9200939
## ice cream        9.7094195  9.6112323  9.3092478  7.9801469  8.0249816
## doughnut         6.0272602  5.3919737  6.1915195  4.7471371  4.6908531
## cookie           5.9792157  5.1804321  5.2111487  5.8960047  4.7263930
## cake             6.9306512  6.6460796  6.9507782  6.1757198  5.5171149
## chocolate bar    6.8142160  6.8219406  7.1039945  6.3920463  5.9894886
## candy            8.4533478  8.6362044  8.8018924  7.9998986  7.5809705
## custard flan     7.0391343  6.3632466  5.4654453  5.5657244  4.8512252
## honey            8.7090411  8.9038844  9.0306961  8.2898196  7.8086214
## milk             6.4430480  6.2579639  5.8273600  5.1221119  4.3801908
## black tea        7.2765663  7.4778081  7.1704206  6.1253855  5.6344315
## sake             7.1428392  7.3341116  7.0312696  5.9707061  5.5563123
## champagne        6.8332022  7.1928351  6.9084132  5.8259008  5.3337307
## red wine         6.4976354  7.0109279  6.7692752  5.6187211  5.0806333
## beer             6.9600634  7.2189952  6.9560448  5.8670167  5.3434104
##                  popcorn rice crackers       rice  spaghetti fried shrimp
## melon                                                                    
## watermelon                                                               
## tangerine                                                                
## lemon                                                                    
## banana                                                                   
## pineapple                                                                
## red apple                                                                
## green apple                                                              
## pear                                                                     
## peach                                                                    
## cherries                                                                 
## strawberry                                                               
## kiwifruit                                                                
## tomato                                                                   
## avocado                                                                  
## eggplant                                                                 
## potato                                                                   
## carrot                                                                   
## corn                                                                     
## hot pepper                                                               
## cucumber                                                                 
## mushroom                                                                 
## peanuts                                                                  
## chestnut                                                                 
## bread                                                                    
## croissant                                                                
## french bread                                                             
## pancakes                                                                 
## cheese                                                                   
## beef                                                                     
## chicken                                                                  
## bacon                                                                    
## hamburger                                                                
## french fries                                                             
## pizza                                                                    
## hotdog                                                                   
## taco                                                                     
## burrito                                                                  
## popcorn                                                                  
## rice crackers 10.9564211                                                 
## rice           9.7730052    11.1047470                                   
## spaghetti      9.1913042    10.8434889  2.7388745                        
## fried shrimp   8.7689158    11.5954931  6.3589078  6.2783229             
## ice cream     12.3431074    13.9071650  8.8920467  9.1989135    8.9466162
## doughnut       8.1359440    11.0957917  5.5561439  5.8552899    5.2986893
## cookie         7.8404223    10.6980774  5.1768905  5.1703680    6.0150111
## cake           9.4406701    11.2596499  7.2094990  6.9817759    5.7383042
## chocolate bar  9.4995152    11.4006877  6.8920867  6.9900183    7.1377593
## candy         11.1838468    12.9329795  6.0038256  6.8257067    8.2511249
## custard flan  10.2418218    11.9138850  4.4593712  4.8846020    6.1540385
## honey         11.4986017    13.1594611  6.5131660  7.2406270    8.7221238
## milk          10.1144096    11.9916505  3.4187791  4.3737118    6.2539942
## black tea     10.9096485    12.7647869  3.1178774  4.6994540    6.8585157
## sake          10.7042582    12.7383574  2.9996339  4.5589600    6.6624220
## champagne     10.5509009    12.4617956  2.8911247  4.5294066    6.6565629
## red wine      10.4155056    12.3154149  2.8881232  4.4704275    6.5396326
## beer          10.7540940    12.5899039  2.9472838  4.5147080    6.5653485
##                ice cream   doughnut     cookie       cake chocolate bar
## melon                                                                  
## watermelon                                                             
## tangerine                                                              
## lemon                                                                  
## banana                                                                 
## pineapple                                                              
## red apple                                                              
## green apple                                                            
## pear                                                                   
## peach                                                                  
## cherries                                                               
## strawberry                                                             
## kiwifruit                                                              
## tomato                                                                 
## avocado                                                                
## eggplant                                                               
## potato                                                                 
## carrot                                                                 
## corn                                                                   
## hot pepper                                                             
## cucumber                                                               
## mushroom                                                               
## peanuts                                                                
## chestnut                                                               
## bread                                                                  
## croissant                                                              
## french bread                                                           
## pancakes                                                               
## cheese                                                                 
## beef                                                                   
## chicken                                                                
## bacon                                                                  
## hamburger                                                              
## french fries                                                           
## pizza                                                                  
## hotdog                                                                 
## taco                                                                   
## burrito                                                                
## popcorn                                                                
## rice crackers                                                          
## rice                                                                   
## spaghetti                                                              
## fried shrimp                                                           
## ice cream                                                              
## doughnut       8.5159270                                               
## cookie         9.3161978  4.4879203                                    
## cake           9.4131177  5.7037328  6.4553875                         
## chocolate bar  8.7929915  4.3011469  5.0413240  6.6059841              
## candy          9.7435497  6.0123597  6.9401391  8.7522780     6.1352732
## custard flan   7.5927976  4.9871444  6.0461069  6.9330465     5.8517605
## honey          9.8175040  6.2737185  7.5555651  9.1172074     6.1573867
## milk           8.1229667  5.8473217  5.7491281  7.2649223     6.4823968
## black tea      8.9186805  6.7393009  6.6713502  8.0812279     7.7634892
## sake           8.8411163  6.4489208  6.3675100  7.8908712     7.4601096
## champagne      8.7660011  6.3891787  6.3105756  7.8488664     7.4061317
## red wine       8.6873118  6.2450161  6.1392436  7.5625209     7.2421407
## beer           8.7689129  6.4902324  6.4716826  7.6097224     7.4823356
##                    candy custard flan      honey       milk  black tea
## melon                                                                 
## watermelon                                                            
## tangerine                                                             
## lemon                                                                 
## banana                                                                
## pineapple                                                             
## red apple                                                             
## green apple                                                           
## pear                                                                  
## peach                                                                 
## cherries                                                              
## strawberry                                                            
## kiwifruit                                                             
## tomato                                                                
## avocado                                                               
## eggplant                                                              
## potato                                                                
## carrot                                                                
## corn                                                                  
## hot pepper                                                            
## cucumber                                                              
## mushroom                                                              
## peanuts                                                               
## chestnut                                                              
## bread                                                                 
## croissant                                                             
## french bread                                                          
## pancakes                                                              
## cheese                                                                
## beef                                                                  
## chicken                                                               
## bacon                                                                 
## hamburger                                                             
## french fries                                                          
## pizza                                                                 
## hotdog                                                                
## taco                                                                  
## burrito                                                               
## popcorn                                                               
## rice crackers                                                         
## rice                                                                  
## spaghetti                                                             
## fried shrimp                                                          
## ice cream                                                             
## doughnut                                                              
## cookie                                                                
## cake                                                                  
## chocolate bar                                                         
## candy                                                                 
## custard flan   6.0259589                                              
## honey          1.6431420    6.1136871                                 
## milk           6.6269141    3.1357521  6.9149035                      
## black tea      6.3318273    4.5397073  6.7247560  2.5914211           
## sake           5.9619636    4.4376138  6.4745274  2.6186090  0.9002461
## champagne      6.1062636    4.3074767  6.5205273  2.3284378  0.7648183
## red wine       6.1693448    4.2442625  6.5498333  2.2111761  1.1045168
## beer           6.1824331    4.3702541  6.6050749  2.4284893  0.7684217
##                     sake  champagne   red wine
## melon                                         
## watermelon                                    
## tangerine                                     
## lemon                                         
## banana                                        
## pineapple                                     
## red apple                                     
## green apple                                   
## pear                                          
## peach                                         
## cherries                                      
## strawberry                                    
## kiwifruit                                     
## tomato                                        
## avocado                                       
## eggplant                                      
## potato                                        
## carrot                                        
## corn                                          
## hot pepper                                    
## cucumber                                      
## mushroom                                      
## peanuts                                       
## chestnut                                      
## bread                                         
## croissant                                     
## french bread                                  
## pancakes                                      
## cheese                                        
## beef                                          
## chicken                                       
## bacon                                         
## hamburger                                     
## french fries                                  
## pizza                                         
## hotdog                                        
## taco                                          
## burrito                                       
## popcorn                                       
## rice crackers                                 
## rice                                          
## spaghetti                                     
## fried shrimp                                  
## ice cream                                     
## doughnut                                      
## cookie                                        
## cake                                          
## chocolate bar                                 
## candy                                         
## custard flan                                  
## honey                                         
## milk                                          
## black tea                                     
## sake                                          
## champagne      0.6867452                      
## red wine       1.0866887  0.5454349           
## beer           0.8474816  0.7387660  0.9634120
#agrupamiento jerarquico

clusters<-hclust((emojiDistancias))

library(ggdendro)
## Warning: package 'ggdendro' was built under R version 4.0.5
dendograma<-ggdendrogram(clusters)
dendograma

library(stringi)

#labels <- EmojisFood[,c(1,2)]

# function para adicionar datos de labels
trimEmojiCode <- function (df,order){
  for(i in 1:nrow(df)){
    index <- order[i]
    df[index,3] <- order[i]
    tmp <- strsplit(stringi::stri_escape_unicode(df[index,2]),"\\\\U000")
    df[i,4] <- tmp[[1]][2]
  }
  colnames(df)<- c('name','emoji','id','code')
  return (df)
}

# Nuevo dataset de labels
labels <- trimEmojiCode(EmojisFood[,c(1,2)], clusters$order)

library('ggimage')
## Warning: package 'ggimage' was built under R version 4.0.5
## Loading required package: ggplot2
library('httr')
## Warning: package 'httr' was built under R version 4.0.5
dendograma<-ggdendrogram(clusters)

dendograma<-dendograma + geom_emoji(data=labels, aes(id,-1, image=code),size=0.03)

dendograma<- dendograma+geom_hline(yintercept=13, color='red')

dendograma <- dendograma + annotate("text", label="corte", x=0, y=14, color='red')

dendograma
## Warning: Removed 58 rows containing missing values (geom_image).

#str(emojiDistancias)
#summary(EmojisFood)