Explore Courses Blog Tutorials Interview Questions
0 votes
in R Programming by (7.3k points)

I have the following data frame

empid <- c(1:4)

empname <- c("Sam","Rob","Max","John")

empdept <- c("Sales","Marketing","HR","R & D") <- data.frame(empid,empname,empdept)

stdid <- c(1:4)

stdname <- c("Alex","Mary","Jim","Jerry")

stdsection <- c("Eco","Sci","Soc","Pol") <- data.frame(stdid,stdname,stddept)

How can I make a list of these data frames? 

1 Answer

0 votes

In R programming, we can directly use the 'list()' function to add data frames to a new list.

In your case,

Mylist <- list(,

The above statement will add the two data frames '' and '' to a list called Mylist.

You can access the elements in the above list by using the following code

Mylist[[1]] , Mylist[[2]]

and so on.

If you want to explore more in R programming then watch this R programming tutorial for beginner:

Browse Categories