R List: How to get the length from a list stored in a key-value list? -


If I store a list or vector in a key-value list, the length of the list returns from length 1 is (). & gt; I & lt; -c (0,1,2,3,4) & gt; Length (i) [1] 5> L & LT; - List (R = 2, I = I) & gt; L ["Eye"] $ i [1] 0 1 2 3 4 & gt; Length (L ["I"]) [1] 1

Why? How to organize a list or vector in a key-value list?

length (L $ I) what you want ... < / P>

  & gt; I & lt; -c (0,1,2,3,4) & gt; I & lt; -c (0,1,2,3,4) & gt; L & LT; - List (R = 2, I = I) & gt; L [ii] $ r [1] 2 $ i [1] 0 1 2 3 4 $ & lt; NA & gt; Tap $ & lt; NA & gt; NULL & gt; L $ i [1] 0 1 2 3 4 & gt; Length (L $ i) [1] 5    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -