title: “Mispriced Diamonds” author: “Tarun Sai Prasad K” date: “January 18, 2018” output: html_document

Reading the file into R

setwd("~/SIP/SIP Phase 2/R Programming/Udemy R Programming A-Z 1")
mydata <- read.csv(paste("Mispriced-Diamonds.csv", sep=""))

Making a scatterplot of the data

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.4.3
ggplot(mydata[mydata$carat<2.5,], aes(x=carat, y=price, colour= clarity))+
geom_point(alpha=0.1)+
geom_smooth()
## `geom_smooth()` using method = 'gam'

#The points where the curves touch each other are the places where there is a mispricing of Diamonds.