Page 36 -
P. 36

> nested_list
                 $m
                 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15

                 $n
                 $n[[1]]
                 [1] "a"


                 $n[[2]]
                 [1] 1 2 3



                 $p
                 $p$x
                 [1]  1  2  3  4  5  6  7  8  9 10

                 $p$y
                 [1] "a" "b"



                 $q
                 $q$x
                 [1] 0 1 2 3 4 5 6 7 8 9


                 $q$y
                 [1] "c" "d"


               좀 더 간결하게 보고 싶다면 str() 함수를 사용하자.

                 > str(nested_list)
                 List of 4
                  $ m: int [1:15] 1 2 3 4 5 6 7 8 9 10 ...
                  $ n:List of 2
                   ..$ : chr "a"
                   ..$ : num [1:3] 1 2 3
                  $ p:List of 2
                   ..$ x: int [1:10] 1 2 3 4 5 6 7 8 9 10
                   ..$ y: chr [1:2] "a" "b"
                  $ q:List of 2
                   ..$ x: int [1:10] 0 1 2 3 4 5 6 7 8 9
                   ..$ y: chr [1:2] "c" "d"





         104





     r교과서_07.indd   104                                                                      2020-04-09   오후 4:21:28
   31   32   33   34   35   36   37   38   39