3+2
## [1] 5
3-1
## [1] 2
3*2
## [1] 6
3/2
## [1] 1.5
3^2
## [1] 9
X<-3
X
## [1] 3
3>4
## [1] FALSE
3>=4
## [1] FALSE
3==4
## [1] FALSE
!(3==4)
## [1] TRUE
TRUE&FALSE
## [1] FALSE
TRUE|FALSE
## [1] TRUE
a<-100
a
## [1] 100
a<-"hello"
a
## [1] "hello"
a<-'hello'
a
## [1] "hello"
0/0
## [1] NaN
a<-c(5,2,3)
a
## [1] 5 2 3
mean(a)
## [1] 3.333333
max(a)
## [1] 5
min(a)
## [1] 2
library(dplyr)
## 
## 다음의 패키지를 부착합니다: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
mode(a)
## [1] "numeric"
is.numeric(a)
## [1] TRUE
is.logical(a)
## [1] FALSE
is.character(a)
## [1] FALSE
length(a)
## [1] 3
x<-c(1,10)
y<-c("apple","melon")
xy<-c(x,y)
xy
## [1] "1"     "10"    "apple" "melon"
1:5
## [1] 1 2 3 4 5
gender<-c("male","female","male")
bloodtype<-c("AB","O","B")
height<-c(170,185,165)
weight<-c(70,65,55)
df<-data.frame(gender,bloodtype,height,weight)
df
##   gender bloodtype height weight
## 1   male        AB    170     70
## 2 female         O    185     65
## 3   male         B    165     55
car<-c("kia","bmw","toyota")
df2<-data.frame(df,car)
df2
##   gender bloodtype height weight    car
## 1   male        AB    170     70    kia
## 2 female         O    185     65    bmw
## 3   male         B    165     55 toyota