I will use package "ggplot2"
when you use about package,you must install ggplot2 package.
After that,I choose the head about "diamonds"by typing head(diamonds).
This picture show the data of diamonds.
Type name(diamonds).
code name(diamonds) show quality of diamonds which is measure the diamonds.
Type hist(diamonds$carat) and run code by press ctrl+enter.
this picture shows histogram of diamonds$carat.
Use package ggplot to show that clarify can test the quality of diamond.
Graph show that clarify can test the quality of diamond.
lm is linear model.
linear model show that price and carat are relative.
"Gplot" can use for comparing price and carat.
Comparing carat and price do not clear.
So,I will use color to describe the data clearly.
Not only carat can measure price of diamonds,but also clarity can measure price of diamonds.
Besides,to compare clarity and price,It can compare other quality such as size and cut.
Size and cut can show real quality of diamonds.So,big size of diamonds and cut of diamonds make the diamonds have expensive price.
if you need to learn more visit :
http://www.ceb-institute.org/bbs/wp-content/uploads/2011/09/handout_ggplot2.pdf
ไม่มีความคิดเห็น:
แสดงความคิดเห็น