# Load the data inside your system
data <- read.csv("Blackwell_Hist_Sample.csv")
# Show the summary of the data
summary(data)
## in.store age items amount
## Min. :0.0000 Min. :18.00 Min. :1.000 Min. : 5.23
## 1st Qu.:0.0000 1st Qu.:33.00 1st Qu.:3.000 1st Qu.: 276.75
## Median :0.0000 Median :45.00 Median :4.000 Median : 570.66
## Mean :0.4555 Mean :45.96 Mean :4.504 Mean : 835.00
## 3rd Qu.:1.0000 3rd Qu.:57.00 3rd Qu.:6.000 3rd Qu.:1249.90
## Max. :1.0000 Max. :85.00 Max. :8.000 Max. :2999.20
## region
## Min. :1.00
## 1st Qu.:2.00
## Median :3.00
## Mean :2.66
## 3rd Qu.:4.00
## Max. :4.00
Let’s add this text inside your document:
The blackwell dataset has 10000 observations.
```
# Creating an histogram of the age
hist(data$age)
Once you have knit the document, let’s modify the chunk options to not show the code using echo=FALSE:
```
To create a Scatter Plot, using ggplot2, we have to install and load the packages “ggplot2”
# Install ggplot2
#install.packages("ggplot2")
# Load ggplot2
library(ggplot2)
## Registered S3 methods overwritten by 'ggplot2':
## method from
## [.quosures rlang
## c.quosures rlang
## print.quosures rlang
# Creating scatter plot amount vs age
ggplot(data, aes(x=amount, y=age)) + geom_point()
The minimum age of the customers is 18, and the maximum is 85.