-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab5.R
41 lines (34 loc) · 906 Bytes
/
lab5.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
library(ggplot2)
library(fmsb)
library(fmsb)
install.packages("fmsb")
library(fmsb)
install.packages("treemap")
library(treemap)
data(airquality)
data(mtcars)
str(airquality)
library(gapminder)
str(gapminder)
library(sqldf)
gm1952=sqldf("select continent, country,
pop/10000 pop from gapminder where year = 1952")
gm2007=sqldf("select continent, country,
pop/10000 pop from gapminder where year = 2007")
data <- rbind(rep(20,10) , rep(0,10) , data)
head(data)
radarchart(data)
#histogram measuring single variable
p1 <- ggplot(airquality, aes(x=Wind)) +
geom_histogram()
p1
#simple comparison
treemap(mtcars,
index=c("gear","mpg"),
vSize="mpg",
type="index"
)
#Multi distribution comparisons
ggplot(mtcars, aes(x = mpg, fill = carb)) +
# Draw overlaying histogram
geom_histogram(position = "identity", alpha = 0.2, bins = 50)