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,550 points
62 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,100 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
1,116 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,720 points
1,000 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
451 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,490 points
1,479 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 8, 2018 in Data Analytics by Abhi
• 3,680 points
195 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,820 points
67 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,100 points
64 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,100 points
1,229 views