Oliva

Author

Walter Hinkley

Oliva

What Part of Italy gives the healthiest olive.

32 Recipes that could even win over the haters

Olive recipes

setwd("~/Desktop/Data Science 110")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library("dslabs")
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(jpeg)
library(ggpubr)
#data(package="dslabs")
list.files(system.file("script", package = "dslabs"))
 [1] "make-admissions.R"                   
 [2] "make-brca.R"                         
 [3] "make-brexit_polls.R"                 
 [4] "make-calificaciones.R"               
 [5] "make-death_prob.R"                   
 [6] "make-divorce_margarine.R"            
 [7] "make-gapminder-rdas.R"               
 [8] "make-greenhouse_gases.R"             
 [9] "make-historic_co2.R"                 
[10] "make-mice_weights.R"                 
[11] "make-mnist_127.R"                    
[12] "make-mnist_27.R"                     
[13] "make-movielens.R"                    
[14] "make-murders-rda.R"                  
[15] "make-na_example-rda.R"               
[16] "make-nyc_regents_scores.R"           
[17] "make-olive.R"                        
[18] "make-outlier_example.R"              
[19] "make-polls_2008.R"                   
[20] "make-polls_us_election_2016.R"       
[21] "make-pr_death_counts.R"              
[22] "make-reported_heights-rda.R"         
[23] "make-research_funding_rates.R"       
[24] "make-stars.R"                        
[25] "make-temp_carbon.R"                  
[26] "make-tissue-gene-expression.R"       
[27] "make-trump_tweets.R"                 
[28] "make-weekly_us_contagious_diseases.R"
[29] "save-gapminder-example-csv.R"        
data("olive")
library(ggthemes)
library(ggrepel)

Olives, What are they good for

Olives are a stone fruit, like a peach or a plum. However, they have a higher oil content and lower sugar content. About 90% of all olives are mad into oil and the other 10% are used for table olives. In these oils are fatty acids that may have many health benefits. The 3 highest percentage of oils are Oleic, Palmitic, and Linoleic. Benefits include lowering the risk of heart disease, lowering cholesterol and inflammation. They can help with cell membrane signaling and cell storage of energy. Growth and development as well as skin health are also benefits. Oleic acid has the highest percentage in olives is a monounsaturated fat, while linoleic is a polyunsaturated fat. Palmitic is a saturated fat. Saturated fats tend to stay solid at room temperature and can cause fatty deposits in blood vessels, leading to atherosclerosis (“hardening of the arteries”). By contrast, unsaturated fats stay liquid at room temperature and are less likely to clog your arteries. verywellhealth.com https://www.verywellhealth.com/difference-between-saturated-fats-and-unsaturated-fats-697517#:~:text=Saturated%20fats%20tend%20to%20stay,likely%20to%20clog%20your%20arteries.

Create new dataframe with wanted columns

oli <- olive[, c(1,2,3,6,7)]
head(oli)
          region         area palmitic oleic linoleic
1 Southern Italy North-Apulia    10.75 78.23     6.72
2 Southern Italy North-Apulia    10.88 77.09     7.81
3 Southern Italy North-Apulia     9.11 81.13     5.49
4 Southern Italy North-Apulia     9.66 79.52     6.19
5 Southern Italy North-Apulia    10.51 77.71     6.72
6 Southern Italy North-Apulia     9.11 79.24     6.78

1 Aggregate just the averages of Oleic acid by area

agg <- aggregate(oleic ~ area, oli, mean)
agg
             area    oleic
1        Calabria 73.07179
2  Coast-Sardinia 70.85788
3    East-Liguria 77.46000
4 Inland-Sardinia 73.60538
5    North-Apulia 78.20400
6          Sicily 73.57833
7    South-Apulia 69.11209
8          Umbria 79.55706
9    West-Liguria 76.74200

Create a new dataframe that pivots the 3 acids to a long format

oli1 <- oli|>
  pivot_longer(
    cols = 3:5,
    names_to = "acids",
    values_to = "acids_percent")
oli1
# A tibble: 1,716 × 4
   region         area         acids    acids_percent
   <fct>          <fct>        <chr>            <dbl>
 1 Southern Italy North-Apulia palmitic         10.8 
 2 Southern Italy North-Apulia oleic            78.2 
 3 Southern Italy North-Apulia linoleic          6.72
 4 Southern Italy North-Apulia palmitic         10.9 
 5 Southern Italy North-Apulia oleic            77.1 
 6 Southern Italy North-Apulia linoleic          7.81
 7 Southern Italy North-Apulia palmitic          9.11
 8 Southern Italy North-Apulia oleic            81.1 
 9 Southern Italy North-Apulia linoleic          5.49
10 Southern Italy North-Apulia palmitic          9.66
# ℹ 1,706 more rows

2 Playing with theme_void (so much nothing)

ggplot(oli, aes(x = oleic, y = palmitic, color = region))+
    geom_point()+
  theme_void()+
  scale_color_manual(values = c("#1b5e20", "#388e3c", "#76ff03"))+
    labs(title = "" ,
         x = "oleic",
         y = "palmitic")

3 Interactive Scatterplot of Oleic acid vs Palmitic acid

oli2 <- ggplot(oli, aes(x = oleic, y = palmitic, color = region))+
    geom_point()+
  theme_classic()+
  scale_color_manual(values = c("#1b5e20", "#388e3c", "#76ff03"))+
  geom_smooth(color="green")+
  labs(title = "Palmitic Acid vs Oleic Acid Percentages" ,
         x = "Oleic Acid Percentage",
         y = "Palmitic Acid Percentage",
       caption = "J. Zupan, and J. Gasteiger. Neural Networks in Chemistry and Drug Design")
oli2 <- ggplotly(oli2)
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
oli2

Olive Summary

Because Oleic acid is a monounsaturated fat it gets a healthier score than the counter part of Palmitic acid(saturated fat) in this visualization. Both fatty acids have positive health benefits but it is interesting that as Oleic acid rises in olives, Palmitic acid goes down. Northern Italy shows a higher average of Oleic acid than the other 2 regions, but interesting the areas of olive growth have very clear percentages of fatty acids in their olives. When looking for a healthier olive maybe looking for olives that come from Northern Italy.

Sources

Data set - DSLABS, Olives data set, J. Zupan, and J. Gasteiger. Neural Networks in Chemistry and Drug Design.

Recipes - https://www.delish.com/cooking/recipe-ideas/g44400522/best-olive-recipes/

Image - https://stocksnap.io/photo/olives-cheese-VUAQNMLAPF