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,130 points
70 views

1 answer to this question.

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,020 points
45 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,020 points
34 views
0 votes
2 answers

How to change column names of a Data frame?

Try this way - names(data frame) <- ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 25,900 points
69 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
117 views
0 votes
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21 in Data Analytics by anonymous
• 25,900 points
121 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
114 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
29 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
79 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
87 views