0

Quick question:

How can I access a variable directly out of a dataframes list?

I tried

df_list[i]$variable which is not working.
or df_list[(i)]$variable...
or df_list[i[1]]

is there a way?

Henrik
  • 41
  • 3

1 Answers1

0

You may use [[ to access the dataframe inside the list. I am assuming you are running in a for loop. To access the variable you may use df_list[[i]]$variable.

You may also read The difference between bracket [ ] and double bracket [[ ]] for accessing the elements of a list or dataframe

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213