0

simple question ahoy:

I have a data frame with three columns: a,b,c. How would I extract a specific column from a variable? For example:

test <- data.frame(3,4,5)
column = "X4"

If I try

test$column

I get NULL. If I try

test$X4

I get the right answer of 4. What am I missing about the test$column bit that isn't working the way I want it to? Thanks!

AI52487963
  • 1,253
  • 2
  • 17
  • 36

0 Answers0