1 What Do You Know About Wine ?

1.1 Brief History of WINE and It’s Styles

Wine is an alcoholic beverage made from grapes, and depending on your definition of “made from grapes” there are at least two independent inventions of it. The oldest known possible evidence for the use of grapes as part of a wine recipe with fermented rice and honey comes from China, about 9,000 years ago (or in 7,000 BC).

In modern days, there are nine primary styles, each style has its own subcategories that exemplify the complex flavor profiles and processes of wine. They are : 1. Sparkling Wine 2. Light-Bodied White Wine 3. Full-Bodied White Wine 4. Aromatic White Wine 5. Rose Wine 6. Light-Bodied Red Wine 7. Medium-Bodied Red Wine 8. Full-Bodied Red Wine 9. Dessert Wine

1.2 1. Explanation

Hi! This is my first rmd. I want to create a model for any such business that predicts the rating based on other features, so it can help to increase the demand for new, but promising quality products.

1.2.1 1.1. Content / Rating

Data contains 1 files about 4 wine style/group, such as : red, rose, sparkling and white. The data tell us about rating that will be analyzed further. The File has 10 columns with names : 1. “No” : number row 2. “ï..Name” : wine name 3. “Group_Wine” : group wine, such as : Red, Rose, Sparkling and White wine 4. “Country” : the country origin of wine manufacturer 5. “Region” : the region origin of wine manufacturer 6. “Winery” : the winery origin of wine manufacturer 7. “Rating” : the assessment of wine products provided by people 8. “NumberOfRatings” : the number of people who give an assessment of each wine product 9. “Price” : price list of each wine product 10. “Year” : the years of making each wine product

1.2.2 1.2. Primary Business Problem

Minerva Corp is a big chain restaurant that spread over 100 countries around the world. As one of the leading chain restaurant company, we give the best quality food and beverages, especially wine.

Currently, restaurants still use local distributors to meet the wine supply in each country. Management is considering using Contract Manufacturing/Toll Manufacturing. While as a consideration, the company needs at least Top 10 wine rating from all wine style, such as : Red wine, Rose wine, Sparkling wine and White wine

We can analyze data wine : - with good rating and good Price based on global location around the world - based on Country with biggest wine production, such as Italy (with consideration : if the company take in product from 1 supplier/winery, the company can bid the price)

We hope this data can help the company to consider wine producers that can be recommended to the management.

1.3 2. Preparation Data

1.4 2.1 Input data and library

Make sure our data placed in the same folder our R project data.

I put the data in folder “input_data”

rwine <- read.csv("input_data/rating_wine.csv")
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.5     v dplyr   1.0.7
## v tidyr   1.1.4     v stringr 1.4.0
## v readr   2.0.2     v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(ggpubr)
library(scales)
## 
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
## 
##     discard
## The following object is masked from 'package:readr':
## 
##     col_factor
library(glue)
## 
## Attaching package: 'glue'
## The following object is masked from 'package:dplyr':
## 
##     collapse
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(GGally)
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2

Input data and library are DONE ! Let’s get started

1.5 2.2 Data Inspection

We do inspection data from “rwine” data with some method on the below.

The head() function will show first 6 rows for each variable data.

head(rwine)

The tail() function will show last 6 rows for each variable data.

tail(rwine)

The dim() function will show how many row and column of our data. This function similar with shape() function in python.

dim(rwine)
## [1] 13834    10

We can look the name columns of our data with using names() function.

names(rwine)
##  [1] "No"              "ï..Name"         "Group_Wine"      "Country"        
##  [5] "Region"          "Winery"          "Rating"          "NumberOfRatings"
##  [9] "Price"           "Year"

From our inspection from data “rwine” on above, we can conclude : * The data contain 13834 of rows and 10 of columns * The columns name are : “No”, “ï..Name”, “Group_Wine”, “Country”, “Region”, “Winery”, “Rating”, “NumberOfRatings”, “Price”, and “Year”

1.6 2.2 Data Cleansing & Coertions

Check data type for each column using the str() function.

The str() function will do a sanity check on the structure and show sample data for each variable.

str(rwine)
## 'data.frame':    13834 obs. of  10 variables:
##  $ No             : num  1 2 3 4 5 6 7 8 9 10 ...
##  $ ï..Name        : chr  "Pomerol 2011" "Lirac 2017" "Erta e China Rosso di Toscana 2015" "Bardolino 2019" ...
##  $ Group_Wine     : chr  "Red wine" "Red wine" "Red wine" "Red wine" ...
##  $ Country        : chr  "France" "France" "Italy" "Italy" ...
##  $ Region         : chr  "Pomerol" "Lirac" "Toscana" "Bardolino" ...
##  $ Winery         : chr  "Château La Providence" "Château Mont-Redon" "Renzo Masi" "Cavalchina" ...
##  $ Rating         : num  4.2 4.3 3.9 3.5 3.9 3.7 4 3.9 3.6 3.5 ...
##  $ NumberOfRatings: num  100 100 100 100 100 100 100 100 100 100 ...
##  $ Price          : num  95 15.5 7.45 8.72 29.15 ...
##  $ Year           : chr  "2011" "2017" "2015" "2019" ...

From this result, we find some of data type not in the corect type. We need to convert it into corect type (data coertion). We use as.factor() to change data type from character (chr) to factor.

rwine$No <- as.character(rwine$No)
rwine$Group_Wine <- as.factor(rwine$Group_Wine)
rwine$Year <- as.factor(rwine$Year)

str(rwine)
## 'data.frame':    13834 obs. of  10 variables:
##  $ No             : chr  "1" "2" "3" "4" ...
##  $ ï..Name        : chr  "Pomerol 2011" "Lirac 2017" "Erta e China Rosso di Toscana 2015" "Bardolino 2019" ...
##  $ Group_Wine     : Factor w/ 4 levels "Red wine","Rose wine",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Country        : chr  "France" "France" "Italy" "Italy" ...
##  $ Region         : chr  "Pomerol" "Lirac" "Toscana" "Bardolino" ...
##  $ Winery         : chr  "Château La Providence" "Château Mont-Redon" "Renzo Masi" "Cavalchina" ...
##  $ Rating         : num  4.2 4.3 3.9 3.5 3.9 3.7 4 3.9 3.6 3.5 ...
##  $ NumberOfRatings: num  100 100 100 100 100 100 100 100 100 100 ...
##  $ Price          : num  95 15.5 7.45 8.72 29.15 ...
##  $ Year           : Factor w/ 56 levels "1961.0","1988",..: 37 49 45 53 47 49 47 43 45 43 ...

Each of column already changed into desired data type

Check for missing value

We can use colSums() and anyNA() function to check if there is missing value in our data.

colSums(is.na(rwine))
##              No         ï..Name      Group_Wine         Country          Region 
##               0               0               0               0               0 
##          Winery          Rating NumberOfRatings           Price            Year 
##               0               0               0               0               0

colSums(is.na()) is for check how many missing value in our data. If the result is zero (0), so our data have no missing value.

anyNA(rwine)
## [1] FALSE

anyNA() is for check missing value in our data. If the result is “FALSE”, so our data have no missing value / NA.

Now, rwine dataset is ready to be processed and analyzed.

drop useless column We find a column that won’t be used to our analysis. So, we drop that column.

rwine1 <- subset(rwine, select = -c(No))
rwine1

Rename column we adjust the column name with function names()

names(rwine1)[1] <- "NameofWine"
names(rwine1)
## [1] "NameofWine"      "Group_Wine"      "Country"         "Region"         
## [5] "Winery"          "Rating"          "NumberOfRatings" "Price"          
## [9] "Year"

2 3 Data Explanation

Brief explanation

The summary() function will do a sanity check on the structure and show IQR and class data for each variable.

summary(rwine1)
##   NameofWine                 Group_Wine     Country             Region         
##  Length:13834       Red wine      :8666   Length:13834       Length:13834      
##  Class :character   Rose wine     : 397   Class :character   Class :character  
##  Mode  :character   Sparkling wine:1007   Mode  :character   Mode  :character  
##                     White wine    :3764                                        
##                                                                                
##                                                                                
##                                                                                
##     Winery              Rating      NumberOfRatings       Price         
##  Length:13834       Min.   :2.200   Min.   :   25.0   Min.   :   3.150  
##  Class :character   1st Qu.:3.700   1st Qu.:   56.0   1st Qu.:   9.902  
##  Mode  :character   Median :3.900   Median :  129.0   Median :  15.950  
##                     Mean   :3.866   Mean   :  428.3   Mean   :  33.025  
##                     3rd Qu.:4.100   3rd Qu.:  336.0   3rd Qu.:  32.500  
##                     Max.   :4.900   Max.   :94287.0   Max.   :3410.790  
##                                                                         
##       Year     
##  2016   :1776  
##  2018.0 :1624  
##  2017   :1558  
##  2015   :1396  
##  2018   :1099  
##  2017.0 : 854  
##  (Other):5527

It works well, but a more complete function is the skim() function from the “skimr” package. It breaks down the variables by type with relevant summary information, PLUS a small histogram for each numeric variable.

library(skimr)
skim(rwine1)
Data summary
Name rwine1
Number of rows 13834
Number of columns 9
_______________________
Column type frequency:
character 4
factor 2
numeric 3
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
NameofWine 0 1 6 76 0 10934 0
Country 0 1 5 14 0 33 0
Region 0 1 3 48 0 861 0
Winery 0 1 2 56 0 3505 0

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
Group_Wine 0 1 FALSE 4 Red: 8666, Whi: 3764, Spa: 1007, Ros: 397
Year 0 1 FALSE 56 201: 1776, 201: 1624, 201: 1558, 201: 1396

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Rating 0 1 3.87 0.30 2.20 3.7 3.90 4.1 4.90 ▁▁▇▇▁
NumberOfRatings 0 1 428.32 1838.41 25.00 56.0 129.00 336.0 94287.00 ▇▁▁▁▁
Price 0 1 33.02 70.90 3.15 9.9 15.95 32.5 3410.79 ▇▁▁▁▁

notes : p0 = minimum value p50 = median value p100 = maximum value

Summary :

  1. In Group_Wine, there are : 8666 rows for Red wine, 397 rows for Rose wine, 1007 rows for Sparkling wine and 3764 rows for White wine.

  2. Top 5 Country that making the wine, such as : Italy (3919 rows), France (3436 rows), Spain (1533 rows), Germany (1229 rows), and South Africa (846 rows).

  3. Top 5 Region that making the wine, such as : Rioja (385 rows), Stellenbosch (337 rows), Pfalz (331 rows), Toscana (307 rows) and Champagne (263 rows).

  4. In Rating, 2.200 was the lowest rating that given by people, the best rating was 4.900 with Mean Rating was 3.866, Median Rating was 3.900 and sd Rating was 0.296.

  5. NumberOfRatings is the number of people that give the rating for each wine product. In this column, there are : the least was 25.0, the most people given rating was 94287.0 with Mean was 428.3, Median was 129.0, and sd value was 1838.0.

  6. In Price, 3410.790 was the most expensive one and the lowest price was 3.150 with Mean price 33.025, Median price was 15.950 and sd was 70.899.

  7. Based on the data, Around 1776 wine products has manufactured on the year of 2016.

Check the Outlier within rating and price

boxplot(rwine1$Rating, main="Boxplot for Rating (continuos var)")

boxplot(rwine1$Price, main="Boxplot for Price (continuos var)")

From result above, we find posibilities for the outliers, but from our calculation, sd value in Rating is below mean value (in my oppinion its still be tolerated), so the process may continue. While sd value in Price is above mean value, so data Price have high volatile.

3 4. Data Manipulation & Transformation

3.0.1 4.1. We can do analized data from summary() / skim() on above.

  1. Which Group_Wine given the lowest Rating value?
rwine1[rwine1$Rating == 2.200,]

Answer : Rating 2.200 comes from Group_Wine White wine

  1. Which Group_Wine given the highest Rating value?
rwine1[rwine1$Rating == 4.900,]

Answer : Rating 4.900 comes from Group_Wine White wine

  1. 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

  1. 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

  2. new insight : high range Price from max Price - min Price, so we can say the Price is high volatile

    1. 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

    1. 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.

3.0.2 4.2. We can do analyzed further based on primary business problem

  1. 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)
head(rose)
head(spk)
head(white)

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!

summary(red)
##   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
summary(rose)
##   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
summary(spk)
##   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
summary(white)
##   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
skim(red)
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

skim_variable n_missing complete_rate min max empty n_unique whitespace
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

skim_variable n_missing complete_rate ordered n_unique top_counts
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

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
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 ▇▁▁▁▁
skim(rose)
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

skim_variable n_missing complete_rate min max empty n_unique whitespace
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

skim_variable n_missing complete_rate ordered n_unique top_counts
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

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
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 ▇▁▁▁▁
skim(spk)
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

skim_variable n_missing complete_rate min max empty n_unique whitespace
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

skim_variable n_missing complete_rate ordered n_unique top_counts
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

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
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 ▇▁▁▁▁
skim(white)
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

skim_variable n_missing complete_rate min max empty n_unique whitespace
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

skim_variable n_missing complete_rate ordered n_unique top_counts
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

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
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)
rose_a
spk_a
white_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

  1. On rose wine, the best wine is Garrus Rosé 2018 with Rating point 4.8.

  2. 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

  3. 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
rose_b
spk_b
white_b

Answer : a) On red wine, the best wine product with Price 3410.79 is Pomerol 2012 (Rating 4.7)

  1. On rose wine, the best wine is Clos du Temple 2018 with Price 249.00. (Rating 4.5)

  2. On sparkling wine, the best wine product with Price 495.00 is Cristal Rosé Brut Champagne (Millésimé) 2007 (Rating 4.6)

  3. On white wine, the best wine is Montrachet Grand Cru Marquis de Laguiche 2017 with Price 681.37. (Rating 4.9)

ggcorr(red, label = T)
## 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

  1. 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 :

  1. 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)
  1. 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)
  1. 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)
  1. White wine :
  • The Wine Collection Sauvignon 2016 (Rating 4.7 & Price 142.01)
  • Toscana Bianco 2016 (Rating 4.5 & Price 251.23)
  1. 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)
  1. 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
tail(table(red$Price))
## 
##    1190  1197.9 1266.25    1399 1599.95 3410.79 
##       1       1       1       1       1       1
tail(table(rose$Rating))
## 
## 4.2 4.3 4.4 4.5 4.6 4.8 
##  11   4   1   3   1   1
tail(table(rose$Price))
## 
## 62.54 68.95  89.5 92.15   109   249 
##     1     1     1     1     1     1
tail(table(spk$Rating))
## 
## 4.2 4.3 4.4 4.5 4.6 4.7 
##  83  33  21  19  18   2
tail(table(spk$Price))
## 
##    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
tail(table(white$Price))
## 
## 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 )

  1. 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)

4 5. Explanatory Text & Business Recomendation

Recomendations :

From our calculation above, showing that :

1. If The company want to find supplier from Italy, we can recomend such as :

  1. 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)
  1. 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)
  1. 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)
  1. White wine :
  • The Wine Collection Sauvignon 2016 (Rating 4.7 & Price 142.01)
  • Toscana Bianco 2016 (Rating 4.5 & Price 251.23)

2. If The company want to find supplier with best rating from around the world, we can recomend such as :

  1. Red wine :
  • Barolo Riserva Monfortino 2013 - Italy (Rating 4.8 & Price 1115.50)
  • G 2015 - South Africa (Rating 4.8 & Price 463.03)
  • Beckstoffer Las Piedras Vineyard Cabernet Sauvignon 2015 - United States (Rating 4.8 & Price 368.47)
  • L’Ermita Velles Vinyes Priorat 2008-Spain (Rating 4.8 & Price 672.60)
  • Toscana 2016 - Italy (Rating 4.8 & Price 960.17)
  • Veneto Alzero Cabernet 2009 - Italy (Rating 4.8 & Price 324.95)
  • Promontory 2013 - United States (Rating 4.7 & Price 721.34)
  • Unico 2010 - Spain (Rating 4.7 & Price 320.00)
  • Amarone della Valpolicella Monte Lodoletta 2012 - Italy (Rating 4.7 & Price 270.63)
  • Brunello di Montalcino Riserva 2010 - Italy (Rating 4.7 & Price 270.63)
  1. Rose wine :
  • Garrus Rosé 2018 - France (Rating 4.8 & Price 109.00)
  • La Villa Rosé 2018 - France (Rating 4.6 & Price 68.95)
  • Clos Beylesse Côtes de Provence Rosé 2019 - France (Rating 4.5 & Price 19.90)
  • 281 Rosé 2019 - France (Rating 4.5 & Price 52.89)
  • Clos du Temple 2018 - France (Rating 4.5 & Price 249.00)
  • Les Clans Rosé 2018 - France (Rating 4.4 & Price 54.00)
  • Der Elefant im Porzellanladen 2019 - Austria (Rating 4.3 & Price 18.64)
  • Clos Beylesse Côtes de Provence Rosé 2018 - France (Rating 4.3 & Price 45.00)
  • Les Clans Rosé 2017 - France (Rating 4.3 & Price 62.54)
  • Rosé et Or 2019 - France (Rating 4.3 & Price 24.85)
  1. Sparkling wine :
  • Cristal Rosé Brut Champagne (Millésimé) 2012 - France (Rating 4.7 & Price 449.90)
  • Cristal Brut Champagne (Millésimé) 2002 - France (Rating 4.7 & Price 363.75)
  • Sir Winston Churchill Brut Champagne 2009 - France (Rating 4.6 & Price 184.24)
  • Brut Champagne 2010 - France (Rating 4.6 & Price 167.48)
  • Belle Epoque Rosé Brut Champagne 2002 - France (Rating 4.6 & Price 259.95)
  • N.P.U Brut Champagne (Nec Plus Ultra) 2002 - France (Rating 4.6 & Price 174.97)
  • La Grande Année Brut Champagne 2012 - France (Rating 4.6 & Price 119.00)
  • Dom Ruinart Rosé Brut Champagne 2004 - France (Rating 4.6 & Price 259.00)
  • Alexandra Champagne Rosé (Grande Cuvée) 2004 - France (Rating 4.6 & Price 349.00)
  • Cristal Rosé Brut Champagne (Millésimé) 2007 - France (Rating 4.6 & Price 495.00)
  1. White wine :
  • Montrachet Grand Cru Marquis de Laguiche 2017 - France (Rating 4.9 & Price 681.37)
  • Ermitage de l’Orée 2004 - France (Rating 4.8 & Price 189.95)
  • The Wine Collection Sauvignon 2016 - Italy (Rating 4.7 & Price 142.01)
  • Bâtard-Montrachet Grand Cru 2015 - France (Rating 4.6 & Price 520.00)
  • Zeltinger Schlossberg Riesling Trockenbeerenauslese 2006 - Germany (Rating 4.6 & Price 95.55)
  • Wehlener Sonnenuhr Riesling Auslese 2015 - Germany (Rating 4.6 & Price 99.95)
  • Corton-Charlemagne Grand Cru 2015 - France (Rating 4.6 & Price 221.95)
  • Kirchspiel Riesling GG 2015 - Germany (Rating 4.6 & Price 179.00)
  • Kirchspiel Riesling GG 2012 - Germany (Rating 4.6 & Price 179.00)
  • Vieilles Vignes Châteauneuf-du-Pape Blanc 2014 - France (Rating 4.6 & Price 135.50)