23/12/1
r 을 배우면서 기억에 남기려고 작성중.
벡터의 생김새를 알기위한 코드들
> typeof(1.2)
[1] "double"
> mode(1.2)
[1] "numeric"
> str(1.2)
num 1.2
데이터 프레임의 모양
> str(data.frame)
function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,
fix.empty.names = TRUE, stringsAsFactors = FALSE)
> str(df)
'data.frame': 5 obs. of 2 variables:
$ name : chr "john" "doe" "jang" "lee" ...
$ score: num 4 3.9 2.4 3.7 3.5
> dim(df)
[1] 5 2
> mode(df)
[1] "list"