makeDataFrame {BBmisc} | R Documentation |
Initialize data.frame in a convenient way.
makeDataFrame(nrow, ncol, col.types, init, row.names = NULL, col.names = sprintf("V%i", seq_len(ncol)))
nrow |
[ |
ncol |
[ |
col.types |
[ |
init |
[any] |
row.names |
[ |
col.names |
[ |
print(makeDataFrame(3, 2, init=7))
## V1 V2
## 1 7 7
## 2 7 7
## 3 7 7
print(makeDataFrame(3, 2, "logical"))
## V1 V2
## 1 FALSE FALSE
## 2 FALSE FALSE
## 3 FALSE FALSE
print(makeDataFrame(3, 2, c("logical", "numeric")))
## V1 V2
## 1 FALSE 0
## 2 FALSE 0
## 3 FALSE 0