### Name: data.frame ### Title: Data Frames ### Aliases: data.frame default.stringsAsFactors ### Keywords: classes methods ### ** Examples L3 <- LETTERS[1:3] (d <- data.frame(cbind(x=1, y=1:10), fac=sample(L3, 10, replace=TRUE))) ## The same with automatic column names: data.frame(cbind( 1, 1:10), sample(L3, 10, replace=TRUE)) is.data.frame(d) ## do not convert to factor, using I() : (dd <- cbind(d, char = I(letters[1:10]))) rbind(class=sapply(dd, class), mode=sapply(dd, mode)) stopifnot(1:10 == row.names(d))# {coercion} (d0 <- d[, FALSE]) # NULL data frame with 10 rows (d.0 <- d[FALSE, ]) # <0 rows> data frame (3 cols) (d00 <- d0[FALSE,]) # NULL data frame with 0 rows