How to create a list of Data frames?

0 votes

I want create a list in which I can access the different data frames as a part of list?

Here is the two data frames:

df1<- data.frame(a=c(8,9,10),b=c(11,12,13),c=c(14,15,16))

df2<-data.frame(d=c(17,18,19),e=c(20,21,22),f=c(23,24,25))
Apr 9, 2018 in Data Analytics by DataKing99
• 8,100 points
32 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Basically all we have to do is to stick to basics:

df1<- data.frame(a=c(8,9,10),b=c(11,12,13),c=c(14,15,16))

df2<-data.frame(d=c(17,18,19),e=c(20,21,22),f=c(23,24,25))

new_list<-list(df1,df2)

new_list[[1]]
   a  b  c
1  8 11 14
2  9 12 15
3 10 13 16
answered Apr 9, 2018 by DeepCoder786
• 1,700 points

Related Questions In Data Analytics

0 votes
1 answer

How to join a list of data frames using map()

You can use reduce set.seed(24) r1 <- map(c(5, 10, ...READ MORE

answered Apr 11, 2018 in Data Analytics by kappa3010
• 2,010 points
20 views
0 votes
1 answer
0 votes
1 answer

How can I use parallel so that it preserves the list of data frames

You can use pmap as follows: nc <- ...READ MORE

answered Apr 4, 2018 in Data Analytics by kappa3010
• 2,010 points
18 views
0 votes
1 answer

How to change column names of a Data frame?

Easiest way: names(prices)[1]<-paste0("old") names(prices)[2]<-paste0("new") names(prices)[3]<-paste0("best") #or by using colnames colnames(prices)<-c("old","new","best") prices old ...READ MORE

answered Apr 11, 2018 in Data Analytics by DeepCoder786
• 1,700 points
23 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,700 points
60 views
0 votes
1 answer

How to sort a data frame by columns in R?

You can just use the order function ...READ MORE

answered Apr 10, 2018 in Data Analytics by darklord
• 6,140 points
52 views
0 votes
1 answer

How to replace NA values in a dataframe with Zero's ?

It is simple and easy: df1<-as.data.frame(matrix(sample(c(NA, 1:10), 100, ...READ MORE

answered Apr 10, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
63 views
0 votes
1 answer

How to drop data frame columns by name?

Easily you can do it: drops <- c("V2","V4") df1[ ...READ MORE

answered Apr 10, 2018 in Data Analytics by DeepCoder786
• 1,700 points
13 views
0 votes
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,700 points
31 views
0 votes
1 answer

How to spilt a column of a data frame into multiple columns

it is easily achievable by using "stringr" ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,700 points
23 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.