0

Creating a list of dataframes:

my_dict <- list(df1=read.table("file1", skip=19, sep='\t', header=TRUE), df2=read.table("file2", skip=19, sep='\t', header=TRUE) )

Why is class(my_dict["file1"]) a list and my_dict$file1 a dataframe? What if I need to access my_dict$file1 with a variable instead of file1 directly?

example: a <- "file1"

my_dict$a gives NULL

Caterina
  • 775
  • 9
  • 26

0 Answers0