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,320 points
43 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
• 9,900 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 2, 2018 in Data Analytics by Bharani
• 4,560 points
686 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,710 points
665 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 18, 2018 in Data Analytics by Bharani
• 4,560 points
183 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
• 32,440 points
146 views
+9 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 8, 2018 in Data Analytics by Anmol
• 3,680 points
97 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,800 points
47 views
0 votes
1 answer
0 votes
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
• 9,900 points
39 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
• 9,900 points
426 views