library(GDAdata)
data("HRstars")

colors

##1 Using dataset HRstars from package GDAdata, generate the following output with palette OrRd with 5 colour shades (Use function smoothScatter

library(RColorBrewer)
colos=brewer.pal(5,"OrRd")
pal=colorRampPalette(colos)
smoothScatter(HRstars$BV,HRstars$Uncert,colramp =pal)

  1. Consider the dataset Boston in package MASS. Generate the following graph using palette

Paired:

library(MASS)
data("Boston")
names(Boston)
##  [1] "crim"    "zn"      "indus"   "chas"    "nox"     "rm"      "age"    
##  [8] "dis"     "rad"     "tax"     "ptratio" "black"   "lstat"   "medv"
medv1=Boston$medv
lstat1=Boston$lstat
chas1=Boston$chas
library(RColorBrewer)
paired=brewer.pal(5,"OrRd")
pal=colorRampPalette(paired)

library(colorspace)
pal<-choose_palette()
library(ggplot2)
Boston$chas=factor(Boston$chas)
ggplot(Boston,aes(lstat,medv,color=chas))+geom_point()+xlab("lower status of the population")+
  ylab("median value of owner occupied homes in $100$")+ggtitle("\n             status wise comparison with rivers")+scale_colour_brewer(palette ="Paired")