Thank you for that insight. :)
Creating the vector still takes time proportional to the length of the vector. In fact, it appears that in your example, the vector packages optimizes the creation time to create only up to the element that you actually demand.
The linear time you're seeing is not the result of an inefficiency of vector indexing, but the result of an efficiency in vector creation.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com