4.1. We can do analized data from summary() / skim() on above.
- Which
Group_Wine given the lowest Rating value?
rwine1[rwine1$Rating == 2.200,]
Answer : Rating 2.200 comes from Group_Wine White wine
- Which
Group_Wine given the highest Rating value?
rwine1[rwine1$Rating == 4.900,]
Answer : Rating 4.900 comes from Group_Wine White wine
- Which
Country and Group_Wine having the expensive Price and the lowest Price? How do you think ? Do you get new insight from the result below ?
#a) the expensive Price
rwine1[rwine1$Price == 3410.790,]
#b) the lowest Price
rwine1[rwine1$Price == 3.150,]
Answer : a) Pomerol 2012 from Group_Wine Red wine and Country France has the most expensive Price around 3410.790 dollar
Frizzantino Dolce N.V. and Lambrusco dellâ\200\231Emilia Dolce N.V. which both are from Group_Wine Sparkling wine and Country Italy has the lowest Price around 3.150 dollar
new insight : high range Price from max Price - min Price, so we can say the Price is high volatile
- Please make plot for distribution data price dan rating! Please explain your insight from your plot !
rwine11 <- as.data.frame(table(rwine1$Group_Wine, rwine1$Rating))
rwine11 <- rwine11[order(rwine11$Freq, decreasing = T),]
rwine11
library(ggplot2)
a <- ggplot(data = rwine11, mapping = aes(x = Freq, y = reorder(Var2, Freq))) +
geom_col(mapping = aes(fill = Var1), position = "stack" ) +
labs(x = "Frequency",
y = "Rating",
title = "The Global Wine Rating")+
theme(axis.text.x = element_text(angle = 90,
hjust = 1))
a

rwine12 <- as.data.frame(table(rwine1$Group_Wine, rwine1$Price))
rwine12 <- rwine12[order(rwine12$Var2, decreasing = T),]
rwine121 <- head(rwine12,100)
head(rwine121)
b0 <- ggplot(data = rwine121 , mapping = aes(x = Var1 , y = Freq)) +
geom_jitter(aes(size = Var2), col = "red",
alpha = 0.5)+
labs(x = "Group Wine",
y = "Frequency",
title = "The List of Global Wine Price")
b0
## Warning: Using size for a discrete variable is not advised.
Insight : Red Wine variant is more Price Range below 1000, but one of kind red wine has the highest Price
- Buat Plot yang sesuai untuk menunjukkan korelasi data price dan rating per group wine ! Please explain your insight from your plot !
ggcorr(rwine1, label = T, hjust = 0.9)
## Warning in ggcorr(rwine1, label = T, hjust = 0.9): data in column(s)
## 'NameofWine', 'Group_Wine', 'Country', 'Region', 'Winery', 'Year' are not
## numeric and were ignored

Answer : From heatmap on above, we can say that Rating and Price have corelation maximum 0,5.
4.2. We can do analyzed further based on primary business problem
- Please make new table with subsetting based on each Group_Wine !
Answer :
# object red, rose, sparkling, white
red <- rwine1[rwine1$Group_Wine=="Red wine",]
rose <- rwine1[rwine1$Group_Wine=="Rose wine",]
spk <- rwine1[rwine1$Group_Wine=="Sparkling wine",]
white <- rwine1[rwine1$Group_Wine=="White wine",]
# check data
head(red)
6.How we know the IQR and other measure that we can get from each object on number 4 above ? We can use summary() or skim() function!
## NameofWine Group_Wine Country Region
## Length:8666 Red wine :8666 Length:8666 Length:8666
## Class :character Rose wine : 0 Class :character Class :character
## Mode :character Sparkling wine: 0 Mode :character Mode :character
## White wine : 0
##
##
##
## Winery Rating NumberOfRatings Price
## Length:8666 Min. :2.50 Min. : 25.0 Min. : 3.55
## Class :character 1st Qu.:3.70 1st Qu.: 66.0 1st Qu.: 10.68
## Mode :character Median :3.90 Median : 157.0 Median : 18.20
## Mean :3.89 Mean : 415.3 Mean : 39.15
## 3rd Qu.:4.10 3rd Qu.: 401.0 3rd Qu.: 38.14
## Max. :4.80 Max. :20293.0 Max. :3410.79
##
## Year
## 2016 :1776
## 2017 :1558
## 2015 :1396
## 2018 :1099
## 2014 : 798
## 2013 : 564
## (Other):1475
## NameofWine Group_Wine Country Region
## Length:397 Red wine : 0 Length:397 Length:397
## Class :character Rose wine :397 Class :character Class :character
## Mode :character Sparkling wine: 0 Mode :character Mode :character
## White wine : 0
##
##
##
## Winery Rating NumberOfRatings Price
## Length:397 Min. :2.700 Min. : 25.0 Min. : 3.67
## Class :character 1st Qu.:3.600 1st Qu.: 40.0 1st Qu.: 7.19
## Mode :character Median :3.700 Median : 72.0 Median : 8.90
## Mean :3.741 Mean : 261.7 Mean : 12.53
## 3rd Qu.:3.900 3rd Qu.: 167.0 3rd Qu.: 12.85
## Max. :4.800 Max. :29531.0 Max. :249.00
##
## Year
## 2019.0 :176
## 2018.0 :156
## 2017.0 : 41
## 2016.0 : 12
## 2014.0 : 3
## 2015.0 : 3
## (Other): 6
## NameofWine Group_Wine Country Region
## Length:1007 Red wine : 0 Length:1007 Length:1007
## Class :character Rose wine : 0 Class :character Class :character
## Mode :character Sparkling wine:1007 Mode :character Mode :character
## White wine : 0
##
##
##
## Winery Rating NumberOfRatings Price
## Length:1007 Min. :3.200 Min. : 25 Min. : 3.15
## Class :character 1st Qu.:3.700 1st Qu.: 102 1st Qu.: 11.90
## Mode :character Median :3.800 Median : 259 Median : 19.45
## Mean :3.881 Mean : 1506 Mean : 34.80
## 3rd Qu.:4.100 3rd Qu.: 844 3rd Qu.: 39.05
## Max. :4.700 Max. :94287 Max. :495.00
##
## Year
## N.V. :728
## 2015.0 : 29
## 2018.0 : 28
## 2017.0 : 26
## 2012.0 : 25
## 2016.0 : 22
## (Other):149
## NameofWine Group_Wine Country Region
## Length:3764 Red wine : 0 Length:3764 Length:3764
## Class :character Rose wine : 0 Class :character Class :character
## Mode :character Sparkling wine: 0 Mode :character Mode :character
## White wine :3764
##
##
##
## Winery Rating NumberOfRatings Price
## Length:3764 Min. :2.200 Min. : 25.0 Min. : 3.74
## Class :character 1st Qu.:3.600 1st Qu.: 43.0 1st Qu.: 9.26
## Mode :character Median :3.800 Median : 77.0 Median : 13.15
## Mean :3.818 Mean : 187.6 Mean : 20.62
## 3rd Qu.:4.000 3rd Qu.: 174.2 3rd Qu.: 20.86
## Max. :4.900 Max. :62980.0 Max. :681.37
##
## Year
## 2018.0 :1440
## 2017.0 : 787
## 2019.0 : 588
## 2016.0 : 484
## 2015.0 : 250
## 2014.0 : 85
## (Other): 130
Data summary
| Name |
red |
| Number of rows |
8666 |
| Number of columns |
9 |
| _______________________ |
|
| Column type frequency: |
|
| character |
4 |
| factor |
2 |
| numeric |
3 |
| ________________________ |
|
| Group variables |
None |
Variable type: character
| NameofWine |
0 |
1 |
6 |
75 |
0 |
6721 |
0 |
| Country |
0 |
1 |
5 |
13 |
0 |
30 |
0 |
| Region |
0 |
1 |
3 |
48 |
0 |
624 |
0 |
| Winery |
0 |
1 |
3 |
56 |
0 |
2714 |
0 |
Variable type: factor
| Group_Wine |
0 |
1 |
FALSE |
1 |
Red: 8666, Ros: 0, Spa: 0, Whi: 0 |
| Year |
0 |
1 |
FALSE |
32 |
201: 1776, 201: 1558, 201: 1396, 201: 1099 |
Variable type: numeric
| Rating |
0 |
1 |
3.89 |
0.31 |
2.50 |
3.70 |
3.9 |
4.10 |
4.80 |
▁▁▇▇▁ |
| NumberOfRatings |
0 |
1 |
415.29 |
899.73 |
25.00 |
66.00 |
157.0 |
401.00 |
20293.00 |
▇▁▁▁▁ |
| Price |
0 |
1 |
39.15 |
84.94 |
3.55 |
10.68 |
18.2 |
38.14 |
3410.79 |
▇▁▁▁▁ |
Data summary
| Name |
rose |
| Number of rows |
397 |
| Number of columns |
9 |
| _______________________ |
|
| Column type frequency: |
|
| character |
4 |
| factor |
2 |
| numeric |
3 |
| ________________________ |
|
| Group variables |
None |
Variable type: character
| NameofWine |
0 |
1 |
9 |
54 |
0 |
337 |
0 |
| Country |
0 |
1 |
5 |
13 |
0 |
16 |
0 |
| Region |
0 |
1 |
4 |
26 |
0 |
129 |
0 |
| Winery |
0 |
1 |
3 |
54 |
0 |
288 |
0 |
Variable type: factor
| Group_Wine |
0 |
1 |
FALSE |
1 |
Ros: 397, Red: 0, Spa: 0, Whi: 0 |
| Year |
0 |
1 |
FALSE |
9 |
201: 176, 201: 156, 201: 41, 201: 12 |
Variable type: numeric
| Rating |
0 |
1 |
3.74 |
0.27 |
2.70 |
3.60 |
3.7 |
3.90 |
4.8 |
▁▃▇▃▁ |
| NumberOfRatings |
0 |
1 |
261.73 |
1568.11 |
25.00 |
40.00 |
72.0 |
167.00 |
29531.0 |
▇▁▁▁▁ |
| Price |
0 |
1 |
12.53 |
16.04 |
3.67 |
7.19 |
8.9 |
12.85 |
249.0 |
▇▁▁▁▁ |
Data summary
| Name |
spk |
| Number of rows |
1007 |
| Number of columns |
9 |
| _______________________ |
|
| Column type frequency: |
|
| character |
4 |
| factor |
2 |
| numeric |
3 |
| ________________________ |
|
| Group variables |
None |
Variable type: character
| NameofWine |
0 |
1 |
9 |
75 |
0 |
841 |
0 |
| Country |
0 |
1 |
5 |
14 |
0 |
16 |
0 |
| Region |
0 |
1 |
4 |
43 |
0 |
123 |
0 |
| Winery |
0 |
1 |
3 |
34 |
0 |
377 |
0 |
Variable type: factor
| Group_Wine |
0 |
1 |
FALSE |
1 |
Spa: 1007, Red: 0, Ros: 0, Whi: 0 |
| Year |
0 |
1 |
FALSE |
22 |
N.V: 728, 201: 29, 201: 28, 201: 26 |
Variable type: numeric
| Rating |
0 |
1 |
3.88 |
0.27 |
3.20 |
3.7 |
3.80 |
4.10 |
4.7 |
▂▇▆▂▁ |
| NumberOfRatings |
0 |
1 |
1506.08 |
5731.20 |
25.00 |
102.0 |
259.00 |
844.00 |
94287.0 |
▇▁▁▁▁ |
| Price |
0 |
1 |
34.80 |
47.29 |
3.15 |
11.9 |
19.45 |
39.05 |
495.0 |
▇▁▁▁▁ |
Data summary
| Name |
white |
| Number of rows |
3764 |
| Number of columns |
9 |
| _______________________ |
|
| Column type frequency: |
|
| character |
4 |
| factor |
2 |
| numeric |
3 |
| ________________________ |
|
| Group variables |
None |
Variable type: character
| NameofWine |
0 |
1 |
6 |
76 |
0 |
3040 |
0 |
| Country |
0 |
1 |
5 |
14 |
0 |
30 |
0 |
| Region |
0 |
1 |
3 |
42 |
0 |
457 |
0 |
| Winery |
0 |
1 |
2 |
56 |
0 |
1412 |
0 |
Variable type: factor
| Group_Wine |
0 |
1 |
FALSE |
1 |
Whi: 3764, Red: 0, Ros: 0, Spa: 0 |
| Year |
0 |
1 |
FALSE |
22 |
201: 1440, 201: 787, 201: 588, 201: 484 |
Variable type: numeric
| Rating |
0 |
1 |
3.82 |
0.27 |
2.20 |
3.60 |
3.80 |
4.00 |
4.90 |
▁▁▇▆▁ |
| NumberOfRatings |
0 |
1 |
187.57 |
1071.47 |
25.00 |
43.00 |
77.00 |
174.25 |
62980.00 |
▇▁▁▁▁ |
| Price |
0 |
1 |
20.62 |
30.93 |
3.74 |
9.26 |
13.15 |
20.86 |
681.37 |
▇▁▁▁▁ |
Answer : ______________________ Rating | ______________________|__________________________________________________________________________________________ No | Group_Wine | p0 (min) | p25 | p50(median) | p75 | p100(max) | Mean | sd |
________________________________________________________________________________________________________________| 1 | Red wine | 2.500 | 3.700 | 3.900 | 4.100 | 4.800 | 3.890 | 0.309 | ________________________________________________________________________________________________________________| 2 | Rose wine | 2.700 | 3.600 | 3.700 | 3.900 | 4.800 | 3.741 | 0.237 | ________________________________________________________________________________________________________________| 3 | Sparkling wine| 3.200 | 3.700 | 3.800 | 4.100 | 4.700 | 3.881 | 0.269 | ________________________________________________________________________________________________________________| 4 | White wine | 2.200 | 3.600 | 3.800 | 4.000 | 4.900 | 3.818 | 0.267 | ________________________________________________________________________________________________________________|
Price |
______________________|__________________________________________________________________________________________ No | Group_Wine | p0 (min) | p25 | p50(median) | p75 | p100(max) | Mean | sd |
________________________________________________________________________________________________________________| 1 | Red wine | 3.55 | 10.68 | 18.20 | 38.14 | 3410.79 | 39.15 | 84.90 | ________________________________________________________________________________________________________________| 2 | Rose wine | 3.67 | 7.19 | 8.90 | 12.85 | 249.00 | 12.53 | 16.00 | ________________________________________________________________________________________________________________| 3 | Sparkling wine| 3.15 | 11.90 | 19.45 | 39.05 | 495.00 | 34.80 | 47.30 | ________________________________________________________________________________________________________________| 4 | White wine | 3.74 | 9.26 | 13.15 | 20.86 | 681.37 | 20.62 | 30.90 | ________________________________________________________________________________________________________________|
7.How to get the highest Rating wine from each wine style (red, rose, sparkling, white)?
# subsetting data
red_a <- red[red$Rating == 4.8,]
rose_a <- rose[rose$Rating == 4.8,]
spk_a <- spk[spk$Rating == 4.7,]
white_a <- white[white$Rating == 4.9,]
# check data
head(red_a)
Answer : a) On red wine, there are 6 best wine product with Rating point 4.8. They are Barolo Riserva Monfortino 2013, G 2015, Beckstoffer Las Piedras Vineyard Cabernet Sauvignon 2015, L’Ermita Velles Vinyes Priorat 2008, Toscana 2016, and Veneto Alzero Cabernet 2009
On rose wine, the best wine is Garrus Rosé 2018 with Rating point 4.8.
On sparkling wine, there are 2 best wine product with Rating point 4.7. They are Cristal Rosé Brut Champagne (Millésimé) 2012 and Cristal Brut Champagne (Millésimé) 2002
On white wine, the best wine is Montrachet Grand Cru Marquis de Laguiche 2017 with Rating point 4.9.
8.How to get the highest Price wine from each wine style? Is the price affected by the size of the rating? Please explain!
scatter
# subsetting data
red_b <- red[red$Price == 3410.79,]
rose_b <- rose[rose$Price == 249.00,]
spk_b <- spk[spk$Price == 495.00,]
white_b <- white[white$Price == 681.37,]
# check data
red_b
Answer : a) On red wine, the best wine product with Price 3410.79 is Pomerol 2012 (Rating 4.7)
On rose wine, the best wine is Clos du Temple 2018 with Price 249.00. (Rating 4.5)
On sparkling wine, the best wine product with Price 495.00 is Cristal Rosé Brut Champagne (Millésimé) 2007 (Rating 4.6)
On white wine, the best wine is Montrachet Grand Cru Marquis de Laguiche 2017 with Price 681.37. (Rating 4.9)
## Warning in ggcorr(red, label = T): data in column(s) 'NameofWine', 'Group_Wine',
## 'Country', 'Region', 'Winery', 'Year' are not numeric and were ignored

#ggcorr(rose, label = T)
#ggcorr(spk, label = T)
#ggcorr(white, label = T)
Insight : * Red wine : There is correlation relationship between Rating and Price maximum 0.5 * Rose wine : There is correlation relationship between Rating and Price maximum 0.4 * Sparkling wine : There is correlation relationship between Rating and Price maximum 0.7 * White wine : There is correlation relationship between Rating and Price maximum 0.5
- We want to know in Italy as the largest wine producer based on the data above, what the largest Rating wine product and the highest Price wine product ?
# Subsetting red data based on `Country` = "Italy" and assigned to object "red_it"
red_it <- red[red$Country == "Italy",]
# Check data
#red_it
# Use table() method to count and get the highest Rating-Price
tail(table(red_it$Rating))
##
## 4.3 4.4 4.5 4.6 4.7 4.8
## 165 102 53 34 11 3
tail(table(red_it$Price), 7)
##
## 564.4 574.15 632.64 925.08 960.17 965.15 1115.5
## 1 1 3 1 1 2 1
# conditional subseting red_it data based on Rating-Price and assigned to object "rd"
rd <- red_it[red_it$Rating >=4.8 | red_it$Price >= 1115.5, ]
rd
# Subsetting rose data based on `Country` = "Italy" and assigned to object "rose_it"
rose_it <- rose[rose$Country == "Italy",]
# Check data
#rose_it
# Use table() method to count and get the highest Rating-Price
tail(table(rose_it$Rating))
##
## 3.6 3.7 3.8 3.9 4 4.1
## 17 11 18 14 13 8
tail(table(rose_it$Price), 10)
##
## 14.45 14.73 14.89 15.5 17.5 19.37 21.82 28.27 39.5 92.15
## 1 1 1 1 1 1 1 1 1 1
# conditional subseting rose_it data based on Rating-Price and assigned to object "rs"
rs <- rose_it[rose_it$Rating >=4.1 | rose_it$Price >= 92.15, ]
rs
# Subsetting spk data based on `Country` = "Italy" and assigned to object "spk_it"
spk_it <- spk[spk$Country == "Italy",]
# Check data
#spk_it
# Use table() method to count and get the highest Rating-Price
tail(table(spk_it$Rating))
##
## 4.1 4.2 4.3 4.4 4.5 4.6
## 21 17 5 1 2 1
tail(table(spk_it$Price), 10)
##
## 69.9 69.95 87.5 88.9 89 92.53 99 114.17 122.27 239
## 1 1 1 1 1 1 1 1 1 1
# conditional subseting spk_it data based on Rating-Price and assigned to object "sp"
sp <- spk_it[spk_it$Rating >=4.6 | spk_it$Price >= 239, ]
sp
# Subsetting white data based on `Country` = "Italy" and assigned to object "white_it"
white_it <- white[white$Country == "Italy",]
# Check data
#white_it
# Use table() method to count and get the highest Rating-Price
tail(table(white_it$Rating))
##
## 4.1 4.2 4.3 4.4 4.5 4.7
## 58 30 12 6 7 1
tail(table(white_it$Price), 10)
##
## 100.99 101.75 109 110 116 121.25 142.01 184.2 213.4 251.23
## 1 1 2 1 1 1 1 1 1 1
# conditional subseting white_it data based on Rating-Price and assigned to object "wh"
wh <- white_it[white_it$Rating >=4.7 | white_it$Price >= 251.23, ]
wh
Answer :
- Red wine :
- Barolo Riserva Monfortino 2013 (Rating 4.8 & Price 1115.50)
- Toscana 2016 (Rating 4.8 & Price 960.17)
- Veneto Alzero Cabernet 2009 (Rating 4.8 & Price 324.95)
- Rose wine :
- La Rosé de Manincor 2019 (Rating 4.1 & Price 17.50)
- Purple Rosé 2019 (Rating 4.1 & Price 21.82)
- Cerasuolo Montepulciano d’Abruzzo Rosé 2018 (Rating 4.1 & Price 92.15)
- Alìe Rosé Toscana 2019 (Rating 4.1 & Price 12.12)
- Pinot Grigio Blush 2019 (Rating 4.1 & Price 6.16)
- Lumare 2019 (Rating 4.1 & Price 8.72)
- Vetere Paestum Rosato 2019 (Rating 4.1 & Price 19.37)
- Rosa dei Frati Riviera del Garda Classico Rosé 2019(Rating 4.1 & Price 11.20)
- Sparkling wine :
- ‘Giulio Ferrari’ Riserva del Fondatore Rosé 2006 (Rating 4.5 & Price 239.00)
- ‘Giulio Ferrari’ Riserva del Fondatore 2007 (Rating 4.6 & Price 122.27)
- White wine :
- The Wine Collection Sauvignon 2016 (Rating 4.7 & Price 142.01)
- Toscana Bianco 2016 (Rating 4.5 & Price 251.23)
- Is there wine product manufacturer from same
Winery in Italy? Please check for each wine style and show us which winery do you mean !
Answer : There is 466 Winery that manufacturing >=2 wine product
# Use table() method to count based on Winery and get the count >= 2
tail(sort(table(red_it$Winery)),466)
##
## a6mani Albino Armani
## 2 2
## Albola Antichi Vinai
## 2 2
## Araldica Aristocratico
## 2 2
## Astoria Aurelio Settimo
## 2 2
## Badia di Morrona Barbanera
## 2 2
## Biserno Bove
## 2 2
## Ca' del Bosco Cabreo
## 2 2
## Cacchiano Caldora
## 2 2
## Camigliano Canalicchio - Franco Pacenti
## 2 2
## Cantina Bolzano / Kellerei Bozen Cantina di Custoza
## 2 2
## Cantina Rosa del Golfo Cantina Sampietrana
## 2 2
## Cantine Salvatore Cantolio
## 2 2
## Capannelle Capichera
## 2 2
## Capraia Carlo Gentili
## 2 2
## Casaloste Casato di Melzi
## 2 2
## Castelfeder Castellani
## 2 2
## Castellare Castello dei Rampolla
## 2 2
## Cavalchina Citra
## 2 2
## Collavini Colli Vicentini
## 2 2
## Contucci Coppadoro
## 2 2
## Corte Giona Corvo
## 2 2
## Danzante di Lenardo
## 2 2
## Donna Laura Emera
## 2 2
## Endrizzi Enrico Serafino
## 2 2
## Ettore Germano Felline
## 2 2
## Ferrocinto Feudi Bizantini
## 2 2
## Feudo Croce Feudo Maccari
## 2 2
## Fossacolle Franco Molino
## 2 2
## Fratelli Revello Giacomo Conterno
## 2 2
## Gianfranco Alessandria Giodo
## 2 2
## Giuseppe Sedilesu Gorgo
## 2 2
## Grattamacco Grillesino
## 2 2
## Heinrich Mayr (Nusserhof) I Capitani
## 2 2
## Icardi Il Marroneto
## 2 2
## Il Palagione Il Tauro
## 2 2
## Istine La Madonnina
## 2 2
## La Morandina La Tunella
## 2 2
## Lamadoro Le Morette
## 2 2
## Le Ragnaie Lis Neris
## 2 2
## Lvnae Madonna delle Vittorie
## 2 2
## Marco Bonfante Maree d'Ione
## 2 2
## Mascarello Giuseppe e Figlio Masseria Altemura
## 2 2
## Melini Monchiero Carbone
## 2 2
## Montecore Montevertine
## 2 2
## Monti Morgante
## 2 2
## Nanni Copé Nobile delle Rocche
## 2 2
## Olianas Paladin
## 2 2
## Pelassa Peter Sölva
## 2 2
## Piancornello Pio Cesare
## 2 2
## Pira Luigi Podere Brizio
## 2 2
## Poggio di Sotto Poggiotondo
## 2 2
## Ponte Lungo Punica
## 2 2
## Rizzi Roberto Lucarelli
## 2 2
## Roberto Sarotto Rosarubra
## 2 2
## Roveglia S. Cristina
## 2 2
## Salcheto Sammontana
## 2 2
## San Giusto a Rentennano San Leonino
## 2 2
## Santa Margherita Schiopetto
## 2 2
## Selvapiana Serpaia di Endrizzi
## 2 2
## Serre dei Roveri SIGNÆ
## 2 2
## Talamonti Tenimenti Ca'Bianca
## 2 2
## Tenuta di Gracciano della Seta Tenuta Giustini
## 2 2
## Tenuta Gorghi Tondi Tenuta Iuzzolini
## 2 2
## Tenuta Orsumella Terre Avare
## 2 2
## Teruzzi & Puthod Theresa Eccher
## 2 2
## Tolaini Torre Alle Tolfe
## 2 2
## Torre Rosazza Torresella
## 2 2
## Valle Reale Villa di Vetrice
## 2 2
## Wilhelm Walch Aia Vecchia
## 2 3
## Ampeleia Antonelli San Marco
## 3 3
## Arnaldo-Caprai BelColle
## 3 3
## Bera Biscardo
## 3 3
## Borgo Molino Boscaini Carlo
## 3 3
## Brigaldara Broccardo
## 3 3
## Bruni Ca La Bionda
## 3 3
## Capezzana Casa Vinicola Bennati
## 3 3
## Casetta Castello di Monsanto
## 3 3
## Castello di Uzzano Castello Romitorio
## 3 3
## Cellaro Cielo e Terra
## 3 3
## Col del Mondo Collefrisio
## 3 3
## Collosorbo Comm. G.B. Burlotto
## 3 3
## Conde Conti di Buscareto
## 3 3
## Corte Figaretto Costa di Bussia - Tenuta Arnulfo
## 3 3
## Cottini De Vescovi Ulzbach
## 3 3
## Drei Donà - Tenuta La Palazza E. Pira & Figli
## 3 3
## Fanti Fattoria Aldobrandesca
## 3 3
## Fattoria dei Barbi Fattoria di Magliano
## 3 3
## Fertuna Feudi Branciforti dei Bordonaro
## 3 3
## Franz Gojer Gianni Brunelli
## 3 3
## Giulia Negri Il Valentiano
## 3 3
## Ippolito 1845 Itinera Prima Classe
## 3 3
## La Gerla Latentia Winery
## 3 3
## Le Mortelle Lodali
## 3 3
## Luccarelli Lunadoro
## 3 3
## Manincor Masciarelli
## 3 3
## Masseria La Volpe Masseto
## 3 3
## Mastroberardino Moncaro
## 3 3
## Monte Dall'Ora Montedidio
## 3 3
## Palazzo Maffei Panizzi
## 3 3
## Parusso Peter Zemmer
## 3 3
## Pietra Pura Podere le Ripi
## 3 3
## Podere Sapaio Poderi del Paradiso
## 3 3
## Poggio delle Faine Poggio le Volpi
## 3 3
## Prà Pranzegg
## 3 3
## Pratello Renato Ratti
## 3 3
## Ricossa Rocca
## 3 3
## Rocca di Frassinello Russo
## 3 3
## Salvioni Santa Cristina
## 3 3
## Sardus Pater Scanavino
## 3 3
## Settesoli Siddura
## 3 3
## Speri Tagaro
## 3 3
## Tenuta Castelbuono Tenuta Il Palagio
## 3 3
## Tenuta le Colonne Tenuta Perano
## 3 3
## Tenuta Sette Ponti Tenuta Ulisse
## 3 3
## Terrescure Torre dei Beati
## 3 3
## Travaglini Valdicava
## 3 3
## Vesevo Vigneti del Vulture
## 3 3
## Villa Canestrari Vivaldi
## 3 3
## A Mano Azienda Agricola Accornero
## 4 4
## Baglio del Cristo di Campobello Bersano
## 4 4
## Bibbiano Brandini
## 4 4
## CÃ dei Frati Caleo
## 4 4
## Cantina Tollo Cantine Leonardo da Vinci
## 4 4
## Capanna Castel Sallegg
## 4 4
## Castiglion del Bosco ColleMassari
## 4 4
## Conte d'Attimis Maniago Cordero di Montezemolo
## 4 4
## Costa Arente Di Majo Norante
## 4 4
## Doppio Passo Elio Filippino
## 4 4
## Fatascia Ferruccio Carlotto
## 4 4
## Gabbas Gulfi
## 4 4
## Le Macchiole Le Ragose
## 4 4
## Leone de Castris Livio Felluga
## 4 4
## Lo Zoccolaio Luna Argenta
## 4 4
## Maestro Italiano Monte del Frá
## 4 4
## Pietroso Poggio Alla Sala
## 4 4
## Poggio Landi Polvanera
## 4 4
## Riecine Roccapesta
## 4 4
## Statti Surrau
## 4 4
## Talenti Tenuta Sant'Antonio
## 4 4
## Tenute Guicciardini Strozzi Terenzi
## 4 4
## Terre degli Svevi Torre d'Orti
## 4 4
## Val delle Rose Val di Suga
## 4 4
## Villa Cerna Villa Poggio Salvi
## 4 4
## Villa Trasqua Villabella
## 4 4
## Aldo Rainoldi Alois Lageder
## 5 5
## Bertani Brovia
## 5 5
## Cascina Luisin Castelforte
## 5 5
## Cesari Collazzi
## 5 5
## Elena Walch Fèlsina
## 5 5
## Fosso Corno Franz Haas
## 5 5
## Giacosa Fratelli Klaus Lentsch
## 5 5
## Latium Morini Mandrarossa
## 5 5
## Masseria Borgo dei Trulli Masseria Pietrosa
## 5 5
## Montalbera Monte Guelfo
## 5 5
## Montellori Nativ
## 5 5
## Negro Angelo Nicolis
## 5 5
## Orma Ottella
## 5 5
## Poderi dal Nespoli Poggio Al Sole
## 5 5
## Poggio Argentiera Principe Corsini
## 5 5
## Rivetti Massimo San Filippo
## 5 5
## Sella & Mosca Talosa
## 5 5
## Tenuta Rapitalà Terlan (Terlano)
## 5 5
## Vallone Villa Cavarena
## 5 5
## Virna Argiolas
## 5 6
## Batasiolo Bolla
## 6 6
## Cantina Kaltern Castelli del Grevepesa
## 6 6
## Cecilia Beretta Conte di Campiano
## 6 6
## Dievole Donnafugata
## 6 6
## Luce della Vite Marchesi di Barolo
## 6 6
## Paolo Cottini Paolo Manzone
## 6 6
## Paololeo Pico Maccario
## 6 6
## Poggio Antico Poggio San Polo
## 6 6
## Rocca di Castagnoli San Donaci
## 6 6
## San Leonardo Santadi
## 6 6
## Santi Siro Pacenti
## 6 6
## Stemmari Tenuta Argentiera
## 6 6
## Tenuta Castiglioni Tenuta Degli Dei
## 6 6
## Tenuta dei Sette Cieli Terre del Marchesato
## 6 6
## Vinchio - Vaglio Serra Argiano
## 6 7
## Biondi-Santi Boscarelli
## 7 7
## Casa di Terra Col d'Orcia
## 7 7
## Coppo Fattoria le Pupille
## 7 7
## Feudi di San Gregorio Feudo Arancio
## 7 7
## Fontodi La Braccesca
## 7 7
## Marco Felluga Masca del Tacco
## 7 7
## Menhir Mesa
## 7 7
## Tenuta di Sesta Tinazzi
## 7 7
## Tramin Velenosi
## 7 7
## Aldo Conterno Barone Montalto
## 8 8
## Bibi Graetz Cantine due Palme
## 8 8
## Castello di Ama Castello Nipozzano
## 8 8
## Foradori Librandi
## 8 8
## Lungarotti Mamete Prevostini
## 8 8
## Nals Margreid Ornellaia
## 8 8
## Quintarelli Giuseppe Rocca di Montegrossi
## 8 8
## St. Michael-Eppan Stefano Accordini
## 8 8
## Tedeschi Torrevento
## 8 8
## Zabu Zeni
## 8 8
## Casanova di Neri Castello Monaci
## 9 9
## Cinciole Colterenzio (Schreckbichl)
## 9 9
## Corte Giara Elio Altare
## 9 9
## Falesco Frescobaldi
## 9 9
## Isole e Olena Michele Chiarlo
## 9 9
## Petra San Felice
## 9 9
## Sartori Tenuta Il Poggione
## 9 9
## Bruno Giacosa Castello di Gabbiano
## 10 10
## Elio Grasso Enzo Boglietti
## 10 10
## Mezzacorona Poggio Al Tesoro
## 10 10
## Tenuta delle Terre Nere Altesino
## 10 11
## Ciacci Piccolomini d'Aragona Domenico Clerico
## 11 11
## Firriato Schola Sarmenti
## 11 11
## Tasca d'Almerita Tenute Silvio Nardi
## 11 11
## Tua Rita Zonin
## 11 11
## Mazzei Tenuta CastelGiocondo
## 12 12
## Tenuta San Guido Tormaresca
## 12 12
## Vigneti del Salento Baglio di Pianetto
## 12 13
## Borgogno Braida
## 13 13
## Brancaia Caparzo
## 13 13
## G.D. Vajra Giacomo Fenocchio
## 13 13
## La Spinetta Nino Negri
## 13 13
## Lenotti Mauro Molino
## 14 14
## Poliziano Rocca delle Macìe
## 14 14
## Tommasi Varvaglione
## 14 14
## Zenato Allegrini
## 14 15
## Banfi Elvio Cogno
## 15 15
## Avignonesi Epicuro
## 16 16
## Prunotto Ceretto
## 16 17
## Cusumano Fontanafredda
## 17 17
## Masi Vite Colte
## 18 18
## Ricasoli Ruffino
## 19 19
## San Marzano Vietti
## 19 19
## Planeta Farnese
## 20 21
## Antinori Gaja
## 25 32
# We take 1 example to show Winery Gaja with 32 Product
l <- red_it[red_it$Winery == "Gaja",]
head(l)
- What Year is the best wine for each style (from object red, rose, spk and white)?
# Use table() method to count and get the highest Rating-Price
tail(table(red$Rating))
##
## 4.3 4.4 4.5 4.6 4.7 4.8
## 483 301 149 104 28 6
##
## 1190 1197.9 1266.25 1399 1599.95 3410.79
## 1 1 1 1 1 1
##
## 4.2 4.3 4.4 4.5 4.6 4.8
## 11 4 1 3 1 1
##
## 62.54 68.95 89.5 92.15 109 249
## 1 1 1 1 1 1
##
## 4.2 4.3 4.4 4.5 4.6 4.7
## 83 33 21 19 18 2
##
## 315 336.31 349 363.75 449.9 495
## 1 1 1 1 1 1
tail(table(white$Rating))
##
## 4.4 4.5 4.6 4.7 4.8 4.9
## 41 31 7 1 1 1
##
## 416.02 450 506.89 520 554.1 681.37
## 1 1 1 1 1 1
# conditional subseting red data based on Rating-Price and assigned to object "rd1"
rd1 <- red[red$Rating >=4.8 | red$Price >= 3410.79, ]
head(rd1, 2)
# conditional subseting rose data based on Rating-Price and assigned to object "rs1"
rs1 <- rose[rose$Rating >=4.8 | rose$Price >= 249, ]
rs1
# conditional subseting spk data based on Rating-Price and assigned to object "sp1"
sp1 <- spk[spk$Rating >=4.7 | spk$Price >= 495, ]
sp1
# conditional subseting white data based on Rating-Price and assigned to object "wh1"
wh1 <- white[white$Rating >=4.9 | white$Price >= 681.37, ]
wh1
Answer :
based on Rating : - Red wine => Barolo Riserva Monfortino 2013 (Rating 4.8) - Rose wine => Garrus Rosé 2018 (Rating 4.8) - White wine => Montrachet Grand Cru Marquis de Laguiche 2017 (Rating 4.9) - Sparkling wine => (Rating 4.7) – Cristal Rosé Brut Champagne (Millésimé) 2012 dan – Cristal Brut Champagne (Millésimé) 2002
base on Price : - Red wine => Pomerol 2012 (Price 3410.79) - Rose wine => Clos du Temple 2018 (Price 249) - White wine => Montrachet Grand Cru Marquis de Laguiche 2017 (Price 681.37) - Sparkling wine => Cristal Rosé Brut Champagne (Millésimé) 2007 (Price 495.00 )
- Get the top 10 Rating for each style !
# sort data based on `Rating` by DESC, you can use order() function.
red <- red[order(red$Rating, decreasing = T), ]
# show first 10 rows
head(red, 10)
# sort data based on `Rating` by DESC, you can use order() function.
rose <- rose[order(rose$Rating, decreasing = T), ]
# show first 10 rows
head(rose, 10)
# sort data based on `Rating` by DESC, you can use order() function.
spk <- spk[order(spk$Rating, decreasing = T), ]
# show first 10 rows
head(spk, 10)
# sort data based on `Rating` by DESC, you can use order() function.
white <- white[order(white$Rating, decreasing = T), ]
# show first 10 rows
head(white, 10)