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,250 points
1,326 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,720 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,090 points
1,568 views
0 votes
1 answer

How to combine a list of data frames into one data frame?

Use bind_rows() from the dplyr package: bind_rows(list_of_dataframes, .id ...READ MORE

answered Dec 17, 2020 in Data Analytics by Gitika
• 65,770 points
1,156 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,090 points
1,061 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,720 points
1,912 views
+1 vote
2 answers

How to sort a data frame by columns in R?

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

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
1,800 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,750 points
2,054 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,720 points
826 views
+1 vote
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,720 points
1,655 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,720 points
1,764 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP