This guide shows how to confront the attributes of different objects in order to understand how those objects are similar (based on their attributes) or on the other hand differ one from the other. By plotting these attributes in a matrix it is possible to built a heatmap looking plot.
In this particular case it is possible to confront the cars from their speed or gears or miles per gallon. As you can see the ones that are more luxury cars as Cadillac, Linkoln or Mercedes tend to group by number of gears and consumption of fuel expressed in mpg (miles per gallon) while the modest cars such as Fiat or Toyota for a low consumption and hp(horse power)
The code for creating this kind of plot is given bellow and is straight forward as you don't need to import particular libraries:
heatmap(as.matrix(mtcars),
Rowv=NA,
Colv=NA,
col = heat.colors(256),
scale="column",
margins=c(2,8),
main = "Car characteristics by Model")
The result is displayed in the following picture :
So you will see that the car models that share similar features tend to stay in the same group, thus creating the more densely populate areas, thus a heatmap.
If you enjoyed this article guide on plotting an heatmap in R please show your support to datatreemap.
We will come up with more articles on data visualization so stay tuned.
@originalworks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The @OriginalWorks bot has determined this post by @datatreemap to be original material and upvoted it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
To enter this post into the daily RESTEEM contest, upvote this comment! The user with the most upvotes on their @OriginalWorks comment will win!
For more information, Click Here!
Special thanks to @reggaemuffin for being a supporter! Vote him as a witness to help make Steemit a better place!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @datatreemap! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @datatreemap! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes received
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit