# NOT RUN {
trees1 <- trees
row.names(trees1)[1] <- "a"
trees1[1, 1] <- NA
Str(trees)
Str(trees1)
# }
# NOT RUN {
trees.crazy <- trees
trees.crazy[[2]] <- trees[, 2, drop=FALSE]
Str(trees.crazy) # does not work with data frames with non-atomic columns
# }
# NOT RUN {
abc <- data.frame(a=letters[1:10], b=LETTERS[1:10], c=1:10)
abc[3, 1] <- NA
Str(abc)
abc.new <- Str(abc, as.factor=TRUE)
Str(abc.new)
# }
Run the code above in your browser using DataLab