-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
172 lines (172 loc) · 6.91 KB
/
.Rhistory
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
knitr::opts_chunk$set(echo = TRUE)
ggplot(data=mpg)
libary(ggplot)
library(ggplot)
install.packages("ggplot")
install.packages("ggplot2")
install.packages("ggplot2")
library(ggplot)
library(ggplot2)
ggplot(data=mpg)
# ggplot(data=mpg)
table(mpg)
# ggplot(data=mpg)
summary(mpg)
plot(mpg$displ, mpg$hwy)
install.packages("ggtext")
install.packages("ggtext")
install.packages("ggtext")
install.packages("ggtext")
install.packages("xml2")
install.packages("xml2")
install.packages("ggtext")
# plot(mpg$displ, mpg$hwy)
ggplot(
mpg,
ase(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(
x="displ",
y="hwy",
color="drv"
)
)
# plot(mpg$displ, mpg$hwy)
ggplot(
mpg,
aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(
x="displ",
y="hwy",
color="drv"
)
)
# plot(mpg$displ, mpg$hwy)
ggplot(
mpg,
aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(
x="displ",
y="hwy",
color="drv"
)
)
# plot(mpg$displ, mpg$hwy)
ggplot(
mpg,
aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(
x="displ",
y="hwy",
color="drv"
)
)
# plot(mpg$displ, mpg$hwy)
ggplot(
mpg,
aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(
x="displ",
y="hwy",
color="drv"
)
)
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labels(x="displ", y="hwy", color="drv"))
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy) + geom_point(aes(color=factor(cyl))) + labs(x="displ", y="hwy", color="drv"))
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(cyl))) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy))
+ geom_point(aes(color=factor(drv)))
+ geom_line()
+ labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth() + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth(method="lm") + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy, color="drv")) + geom_point() + geom_line() + geom_smooth(method="lm", se=FALSE)
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
?geom_line()
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy))
+ geom_point(aes(color=factor(drv)))
+ geom_line()
+ geom_smooth(method="lm", se=FALSE)
+ labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_line() + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_smooth() + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_smooth(se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_smooth(method="lm", se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_smooth(se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy)) + geom_point(aes(color=factor(drv))) + geom_point() + geom_smooth(se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy, color=factor(drv))) + geom_point() + geom_smooth(se=FALSE) + labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy, color=factor(drv))) + geom_point() + geom_smooth(se=FALSE)
# labs(x="displ", y="hwy", color="drv")
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy, color=factor(drv))) + geom_point() + geom_smooth(se=FALSE)
# plot(mpg$displ, mpg$hwy)
ggplot(mpg, aes(displ, hwy, color=factor(drv))) + geom_point() + geom_smooth(se=FALSE) +labs(x="displ", y="hwy", color="drv")
?coord flip()
? coord flip
?coord_flip()
str(mpg)
ggplot(mpg, aes(hwy, class)) + labs(x="Highway MPG", y="Class")
coord_flip(ggplot(mpg, aes(hwy, class)) + labs(x="Highway MPG", y="Class"))
ggplot(mpg, aes(hwy, class)) + labs(x="Highway MPG", y="Class")
ggplot(mpg, aes(hwy, class)) + labs(x="Highway MPG", y="Class")
ggplot(mpg, aes(hwy, class)) + geom_boxplot() + labs(x="Highway MPG", y="Class")
shiny::runApp('Projects/dtsc630/app')
runApp('Projects/dtsc630/app')
shiny::runApp('Projects/dtsc630/app')
shiny::runApp('Projects/test/shiny_test/app')
#================================================
# data.frame
#================================================
d <- c(1,2,3,4)
e <- c("red", "white", "red", NA)
f <- c(TRUE,TRUE,TRUE,FALSE)
# Method 1: combine the three vectors into a data frame
mydata <- data.frame(d,e,f)
d <- c(1,2,3,4)
e <- c("red", "white", "red", NA)
f <- c(TRUE,TRUE,TRUE,FALSE)
# Method 1: combine the three vectors into a data frame
mydata <- data.frame(d,e,f)
mydata
d <- c(1,2,3,4)
e <- c("red", "white", "red", NA)
f <- c(TRUE,TRUE,TRUE,FALSE)
mydata <- data.frame(d,e,f)
mydata
runApp('Projects/test/shiny_test/app')
# data <- read.csv('/Users/miketrz/Downloads/DTSC_630_DAta/Categories_KW_Normalized_test.csv')
data <- read.csv('Categories_KW_Normalized_test.csv')
# data <- read.csv('/Users/miketrz/Downloads/DTSC_630_DAta/Categories_KW_Normalized_test.csv')
data <- read.csv('/Categories_KW_Normalized_test.csv')
# set the working dir, make a new line of your working dir
setwd("/home/hui/Projects/dtsc630_main")
# data <- read.csv('/Users/miketrz/Downloads/DTSC_630_DAta/Categories_KW_Normalized_test.csv')
data <- read.csv('/datasets/Categories_KW_Normalized_test.csv')
# data <- read.csv('/Users/miketrz/Downloads/DTSC_630_DAta/Categories_KW_Normalized_test.csv')
data <- read.csv('./datasets/Categories_KW_Normalized_test.csv')
df <- data.frame(matrix(ncol = 11, nrow = 0))
colnames(df)<-c('Cateogry', 'Major', 'Major_W', 'Specialty', 'Specialty_W',
'Tool', 'Tool_W', 'Trait', 'Trait_W', 'Environment', 'Environment_W')
df
runApp('~/Projects/test/shiny_test/app')