1 / 200 * 30 (59 + 73 + 2) / 3 sin(pi / 2)
<–를 사용하면 새 객체가 생성된다.
x <- 3 * 4
객체를 생성하는 모든 R 명령어, 즉 할당문은 다음의 동일한 형식을 갖는다.
객체이름 <- 값
seq( 1 : 10)
## [1] 1 2 3 4 5 6 7 8 9 10
x <- seq(1, 10, length.out = 5)
2.3.1 연습문제
다음의 코드는 왜 작동하지 않는가?
my_variable <- 10 my_varıable
> Error in eval(expr, envir, enclos): object ‘my_varıable’ not found
: 자세히 보면 i 가 아닌 다른 문자가 들어가있다.
다음 각 R 명령어를 올바르게 실행되도록 조정하라.
library(tidyverse)
ggplot(dota = mpg) + geom_point(mapping = aes(x = displ, y = hwy))
fliter(mpg, cyl = 8) filter(diamond, carat > 3)
: library(tidyverse)
ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy))
filter(mpg, cyl == 8) filter(diamonds, carat > 3)