列出套件個數

##ls:list objcts
##search:找出安裝的套件
##lapply(search(), ls):列出所有套件
##length:長度、個數
str(lapply(search(), ls))
## List of 9
##  $ : chr(0) 
##  $ : chr [1:448] "acf" "acf2AR" "add.scope" "add1" ...
##  $ : chr [1:87] "abline" "arrows" "assocplot" "axis" ...
##  $ : chr [1:110] "adjustcolor" "as.graphicsAnnot" "as.raster" "axisTicks" ...
##  $ : chr [1:245] "?" "adist" "alarm" "apropos" ...
##  $ : chr [1:104] "ability.cov" "airmiles" "AirPassengers" "airquality" ...
##  $ : chr [1:218] "addNextMethod" "allGenerics" "allNames" "Arith" ...
##  $ : chr(0) 
##  $ : chr [1:1232] "-" "-.Date" "-.POSIXt" "!" ...
lapply(lapply(search(), ls), length)
## [[1]]
## [1] 0
## 
## [[2]]
## [1] 448
## 
## [[3]]
## [1] 87
## 
## [[4]]
## [1] 110
## 
## [[5]]
## [1] 245
## 
## [[6]]
## [1] 104
## 
## [[7]]
## [1] 218
## 
## [[8]]
## [1] 0
## 
## [[9]]
## [1] 1232