-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
113 lines (113 loc) · 2.07 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
runif()
runif(10)
runif(10) * 10
seed(482)
set.seed(482)
runif(10) * 10
set.seed(482)
runif(10) * 10
set.seed(482)
runif(10) * 10
set.seed(482)
x <- runif(10) * 10
y <- runif(10) * 20
ggplot(aes(x, y)) +
geom_line()
library(flexdashboard)
library(tidyverse)
ggplot(aes(x, y)) +
geom_line()
bind_cols(x, y)
df <- bind_cols(x = x, y = y)
df
df %>%
ggplot(aes(x, y)) +
geom_line()
df %>%
ggplot(aes(x, y)) +
geom_point()
theme_set(theme_light())
library(flexdashboard)
library(tidyverse)
theme_set(theme_light())
set.seed(482)
x <- runif(10) * 10
y <- runif(10) * 20
df <- bind_cols(x = x, y = y)
df %>%
ggplot(aes(x, y)) +
geom_point()
theme_set(
theme_light() +
theme(
panel.grid = element_blank()
)
)
set.seed(482)
x <- runif(10) * 10
y <- runif(10) * 20
df <- bind_cols(x = x, y = y)
df %>%
ggplot(aes(x, y)) +
geom_point()
df(x)
df(as.data.frame(x))
x
x + 5
x + 5 + runif(10)
set.seed(482)
x <- runif(10) * 10
y <- x + 5 + runif(10)
df <- bind_cols(x = x, y = y)
df %>%
ggplot(aes(x, y)) +
geom_point()
y <- x + 5 + (runif(10) * 2)
set.seed(482)
x <- runif(10) * 10
y <- x + 5 + (runif(10) * 2)
df <- bind_cols(x = x, y = y)
df %>%
ggplot(aes(x, y)) +
geom_point()
set.seed(482)
x <- runif(10) * 10
y <- x + 5 + (runif(10) * 5)
df <- bind_cols(x = x, y = y)
df %>%
ggplot(aes(x, y)) +
geom_point()
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth()
?geom_smooth
?poly
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(formula = y ~ poly(x, 2))
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(formula = y ~ poly(x, 2), se = FALSE)
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(formula = y ~ poly(x, 2, raw = TRUE), se = FALSE)
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(method = lm, formula = y ~ poly(x, 2, raw = TRUE), se = FALSE)
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(method = lm, formula = y ~ poly(x, 3, raw = TRUE), se = FALSE)
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(method = lm, formula = y ~ poly(x, 10, raw = TRUE), se = FALSE)
df %>%
ggplot(aes(x, y)) +
geom_point() +
geom_smooth(method = lm, formula = y ~ poly(x, 2, raw = TRUE), se = FALSE)