── 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
Look for data sets to work with
data(package="dslabs") #calling the ds labs infolist.files(system.file("script", package ="dslabs")) #listing the files inside ds labs
I picked the data set on olives because my name is Oliver.
data("olive") #call the data set. This allows me to see the variables in the data set.
I check for any NA values to see if I need to clean the data set.
sum(is.na(olive)) #check for the total amount of NA values in the data
[1] 0
There are no NA values
Now I will make the graph
graph <-ggplot(olive, aes(x = palmitic, y = palmitoleic, color = region)) +#Create a graph variable and set the aestheticsgeom_point() +#make a scatterplottheme_minimal() +#change theme to minimalscale_color_manual(values =c("#ed0e6b", "#0eedd3", "#0eed3f")) +#manually change the colours used for the different regionslabs(x ="Amount of Palmitic Acid", y ="Amount of Palmitoleic Acid", title ="Palmitic vs. Palmitoleic Acid in Olives Across Different Italian Regions", color ="Italian Regions") #label the different aspects of the graphgraph
Paragraph
The data set I have chosen to work with is the one on Olives. This data set details the amount of acids found in the olives of different Italian regions and areas. For the assignment, I chose to only look at two different types of acid; palmitic and palmitoleic. I also chose to work with a third variable, that being the Italian regions. I chose to make a scatter plot as I am most comfortable making those. I set the x and y axis to the different acid types and used the colour aesthetic for the region variable. This would allow the graph to properly show the amount of acids found in the different regions olives. One takeaway from the graph is the high amounts of acidity in southern Italian olives. It would appear Southern Italy has the most acidic olives while Northern italy has the least acidic olives.