What is the internal implementation of lists?

后端 未结 1 834
醉梦人生
醉梦人生 2020-12-10 01:42

I am curious how an object of type list is implemented. Is it

  1. a dynamic vector that will automatically increase its size when it is full.
相关标签:
1条回答
  • 2020-12-10 02:13

    Lists are essentially just arrays of R objects (SEXP). Resizing causes copies of the whole data and name lookup is linear.

    Alternatively, you can use environments, which use hash tables internally.

    0 讨论(0)
提交回复
热议问题