R gl()

1 개요[ | ]

R gl()
  • "Generate Factor Levels→ 팩터 레벨 생성"
Usage
R
Copy
gl(n, k, length = n*k, labels = seq_len(n), ordered = FALSE)

2 실행예시[ | ]

R
Copy
gl(2, 8, labels = c("Control", "Treat"))
##  [1] Control Control Control Control Control Control Control Control Treat  
## [10] Treat   Treat   Treat   Treat   Treat   Treat   Treat  
## Levels: Control Treat
R
Copy
gl(2, 1, 20)
##  [1] 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
## Levels: 1 2
R
Copy
gl(2, 2, 20)
##  [1] 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2
## Levels: 1 2

3 같이 보기[ | ]

4 참고[ | ]