3+2
## [1] 5
3-1
## [1] 2
3*2
## [1] 6
3/2
## [1] 1.5
3^2
## [1] 9
x=3
y<--2
z=1
x
## [1] 3
y
## [1] -2
z
## [1] 1
x>y
## [1] TRUE
x<z
## [1] FALSE
y==z
## [1] FALSE
!(x<y)
## [1] TRUE
a=TRUE
b=FALSE
a&b
## [1] FALSE
a&a
## [1] TRUE
b&b
## [1] FALSE
b&a
## [1] FALSE
a|b
## [1] TRUE
b|b
## [1] FALSE
z<-'Koroad'
z
## [1] "Koroad"
rm(z)
z<-'cwal'
sqrt(-8)
## Warning in sqrt(-8): NaN이 생성되었습니다
## [1] NaN
0/0
## [1] NaN
sqrt(-8)
## Warning in sqrt(-8): NaN이 생성되었습니다
## [1] NaN
1/0
## [1] Inf
-1/0
## [1] -Inf
a<-c(1,2,3)
a
## [1] 1 2 3
min(a)
## [1] 1
max(a)
## [1] 3
mean(a)
## [1] 2
a<-c(1,2,4)
mean(a)
## [1] 2.333333
a
## [1] 1 2 4
mode(a)
## [1] "numeric"
length(a)
## [1] 3
is.numeric(a)
## [1] TRUE
is.logical(a)
## [1] FALSE
is.character(a)
## [1] FALSE
is.logical(b)
## [1] TRUE
is.character(z)
## [1] TRUE
mode(b)
## [1] "logical"
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
c<-c(1:5)
rm(c)
gender<-c('male','female','male')
bloodtype<-c('AB','O','B')
rm(x,y,yz)
## Warning in rm(x, y, yz): 객체 'yz'를 찾을 수 없습니다
rm(xy)
height<-c('170','175','165')
weight<-c('70','65','55')
de<-data.frame(gender,bloodtype,height,weight)
de
##   gender bloodtype height weight
## 1   male        AB    170     70
## 2 female         O    175     65
## 3   male         B    165     55
rm(a,b,z)
car<-c('Kia','BMW','Toyota')
de2<-data.frame(de,car)
de2
##   gender bloodtype height weight    car
## 1   male        AB    170     70    Kia
## 2 female         O    175     65    BMW
## 3   male         B    165     55 Toyota