# plotting charts
data(mtcars)
mtcars$model = rownames(mtcars)

#plotting a scatterplot
plot(x=mtcars$hp, 
    y=mtcars$wt, 
    main ='Scatter plot with horse-power vs weight',
    xlab='Horse Power',
    ylab='Weight of car')

#count the number of rows in table group by cyl
count_cyl = table(mtcars$cyl)

# plotting a bar chart 
barplot(count_cyl, 
    main='count of Cars based on cylendar', 
    xlab = 'No. of cylanders',
    ylab = 'No. of cars',
    col=c('Darkred','yellow','Orange'))
    

# box plots with R
boxplot(hp~gear,
        data=mtcars,
        xlab='No. of gear',
        ylab='Horse Power')


#histogram chart
hist(x=mtcars$hp, col='green',breaks=30)




Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: