0 votes
in R Basics by
If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...

1a.) How do I select the c(4, 5, 6)?

1b.) How do I select the 1?

1c.) How do I select the 5?

1d.) What is df[, 3]?

1e.) What is df[1,]?

1f.) What is df[2, 2]?

1 Answer

0 votes
by

(a) df[[2]] or df$b, (b) df[[1]][[1]] or df$a[[1]], (c) df[[2]][[2]] or df$b[[2]], (d) 7 8 9, (e) 1 4 7, (f) 5.

...