R Programming Converting lists

0 votes

I have the following list:

head(myList)
[[1]]
[1] "a" "b"  

[[2]]
[1] "c" "d"

[[3]]
[1] "e"  "f"

I want to create a data frame like this:

col1   col2
a      b
c      d
e      f

How can this be done?

Jan 28, 2019 in Data Analytics by Tyrion anex
• 8,700 points
333 views

1 answer to this question.

0 votes

Try this:

a<-list(c("a", "b"), c("c", "d"), c("e", "f"))
t(data.frame(a))
answered Jan 28, 2019 by Sophie may
• 10,610 points

Related Questions In Data Analytics

0 votes
1 answer

Converting R data-frame to h2o object

All you have to do is run ...READ MORE

answered Apr 3, 2018 in Data Analytics by Bharani
• 4,660 points
2,367 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
2,321 views
0 votes
1 answer

Converting a string to title case - R

library(tools) toTitleCase("this is sparta") [1] "this is Sparta" ...READ MORE

answered May 19, 2018 in Data Analytics by Bharani
• 4,660 points
1,335 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
14,504 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,155 views
+1 vote
2 answers
0 votes
1 answer

R programming logic

Use gsub to match the substring that we want ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,840 points
483 views
0 votes
1 answer
+1 vote
1 answer

R Programming: matrices

Try this, It will test if a matrix ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 10,610 points
442 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 10,610 points
2,862 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