summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
#1
credit <- read.csv("/var/folders/ty/3f1wqt190wl2cv_7gyxgxnkr0000gn/T//RtmpsgJ5Hj/data1735135b645e", dec=",")
#2
hist (x=credit$amount,col="blue",border="green")
abline(v=2319.5, col="black")
text(x=2319.5,y=400,adj=0, labels=paste('Median = ', median(credit$amount)))

#3
plot(x=credit$age,y=credit$amount,main= "Borrower age and loan amount", xlab= "Borrower Age", ylab="Loan amount (in DM)", xlim=c(0,80), ylim=c(0,20000),col="pink", pch = 8)

?points
#4
#install.packages("beanplot")
library("beanplot")
beanplot(amount~ years_at_residence,
data=credit,
main="Number of years at residence and loan amounts",
xlab="Years at Residence",
ylab="Loan amount in DM(log-transformed",
col="black")
## log="y" selected

#5
plot(x=credit$months_loan_duration, y=credit$amount, pch=8, col="orange", xlim=c(0,80),ylim=c(0,15000),xlab= "Loan Duration (in months)", ylab= "Loan Amount (in DM)")
abline(col="grey", h=seq(0,15000,1000), v=seq(0,80,10))
