When posting a question in R, I see basically 3 approaches to represent a data frame:
#1
df <- data.frame("a" = 1:5, "b" = 6:10, "c" = 11:15)
#2
a b c
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
#3
(The output for dput
)
structure(list(a = 1:5, b = 6:10, c = 11:15), .Names = c("a",
"b", "c"), row.names = c(NA, -5L), class = "data.frame")
In my opinion, #2 is the best for visualization and allows quick answers for simple questions. On the other hand, it is the worst if working with the data is needed.
What are the pros and cons for each approach? Is any of them considered better than the others?