-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
  • 69,533
  • 24
  • 154
  • 197
user1731038
  • 35
  • 1
  • 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,540
  • 2
  • 26
  • 29