-1

I have a list of 3000 vectors in R. How can I create a data frame from the first 1000 elements of this list?

Cheers

Roman Luštrik
  • 67,056
  • 24
  • 151
  • 191
user1731038
  • 35
  • 2
  • 6

1 Answers1

4

You can do:

data.frame(myList[1:1000])

This makes the assumption that the vectors are all the same length. If they are not, values will be recycled.

Christopher Louden
  • 7,317
  • 2
  • 24
  • 29