로딩
요청 처리 중입니다...

[R] Matrix

 [R] Matrix

matrix(1:12, byrow = FALSE, nrow = 4) => 1에서 12까지 4열X3행, 행별로 배열 (byrow 없는 디폴트는 열별) days <- c('Mon', 'Tue', 'Wed', 'Thu', 'Fri') temp1 <- c(16, 18, 19, 22, 17) temp2 <- c(34, 32, 33, 29, 30) temp <- c(temp1, temp2) # 이러면 temp1, 2의 모든 데이터가 한 줄로 정렬 temp.matrix <- matrix(temp, byrow=T, nrow=2) # 한 줄이던 temp를 열 두개의 표에 열별로 데이터 정리 => 16 18 19 22 17 34 32 33 29 30 rownames(temp.matrix) <- c('temp1', 'temp2') colnames(temp.matrix) <- days => Mon Tue Wed Thu Fri temp1 16 18 19 22 17 temp2 34 32 33 29 30 co...

# matrix # R

원문 링크 : [R] Matrix