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 in Data Analytics by Tyrion anex
• 8,280 points
26 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 by Sophie may
• 9,430 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,550 points
462 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,680 points
405 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,550 points
84 views
0 votes
1 answer

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

A variable name in R programming language ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,690 points
70 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,040 points
21 views
0 votes
1 answer
+4 votes
2 answers
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,430 points
25 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,430 points
162 views