df <- read.csv(file='insurance.csv')

plots <- par(mfrow=c(2, 2)) 

corr <- cor(df$charges, df$age)
title <- paste("Charges Age ", sprintf("%s", corr))
plot(df$charges, df$age, main=title, 
   xlab="Charges ", ylab="Age ")

corr <- cor(df$charges, df$bmi)
title <- paste("Charges BMI ", sprintf("%s", corr))
plot(df$charges, df$bmi, main=title, 
   xlab="Charges ", ylab="BMI ")

corr <- cor(df$charges, df$children)
title <- paste("Charges Children ", sprintf("%s", corr))
plot(df$charges, df$children, main=title, 
   xlab="Charges ", ylab="Children ")

corr <- cor(df$charges, df$smoker)
title <- paste("Charges Smoker ", sprintf("%s", corr))
plot(df$charges, df$smoker, main=title, 
   xlab="Charges ", ylab="Smoker ")


par(plots)
