Last active
September 26, 2017 06:57
-
-
Save aravindhebbali/3690e9217c72644a9e9bada0df709426 to your computer and use it in GitHub Desktop.
Data Visualization: Introduction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# help | |
help(plot) | |
help(mtcars) | |
# mtcars | |
head(mtcars) | |
# variable info | |
str(mtcars) | |
# One continuous variable | |
plot(mtcars$mpg) | |
# One categorical variable | |
plot(as.factor(mtcars$cyl)) | |
# Two continuous variables | |
plot(mtcars$disp, mtcars$mpg) | |
# Two categorical variables | |
plot(as.factor(mtcars$am), as.factor(mtcars$cyl)) | |
# Continuous/Categorical variable | |
plot(mtcars$mpg, mtcars$cyl) | |
# Categorical/Continuous variable | |
plot(as.factor(mtcars$cyl), mtcars$mpg) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment