Exercice1:Split the ChickWeight{datasets} data by individual chicks to extract separate slope estimates of regressing weight onto Time for each chick

##      weight           Time           Chick     Diet   
##  Min.   : 35.0   Min.   : 0.00   13     : 12   1:220  
##  1st Qu.: 63.0   1st Qu.: 4.00   9      : 12   2:120  
##  Median :103.0   Median :10.00   20     : 12   3:120  
##  Mean   :121.8   Mean   :10.72   10     : 12   4:118  
##  3rd Qu.:163.8   3rd Qu.:16.00   17     : 12          
##  Max.   :373.0   Max.   :21.00   19     : 12          
##                                  (Other):506

Exercise2: Explain what does this statement do:lapply(lapply(search(), ls), length)

##  [1] ".GlobalEnv"        "package:lattice"   "package:stats"    
##  [4] "package:graphics"  "package:grDevices" "package:utils"    
##  [7] "package:datasets"  "package:methods"   "Autoloads"        
## [10] "package:base"
##       Length Class  Mode     
##  [1,]    1   -none- character
##  [2,]  151   -none- character
##  [3,]  448   -none- character
##  [4,]   87   -none- character
##  [5,]  109   -none- character
##  [6,]  215   -none- character
##  [7,]  104   -none- character
##  [8,]  218   -none- character
##  [9,]    0   -none- character
## [10,] 1229   -none- character
## [[1]]
## [1] 1
## 
## [[2]]
## [1] 151
## 
## [[3]]
## [1] 448
## 
## [[4]]
## [1] 87
## 
## [[5]]
## [1] 109
## 
## [[6]]
## [1] 215
## 
## [[7]]
## [1] 104
## 
## [[8]]
## [1] 218
## 
## [[9]]
## [1] 0
## 
## [[10]]
## [1] 1229

Exercise3:The following R script uses Cushings{MASS} to demonstrates several ways to achieve the same objective in R. Explain the advantages or disadvantages of each method.

##                            a    b     c        u
## Tetrahydrocortisone 2.966667 8.18 19.72 14.01667
## Pregnanetriol       2.440000 1.12  5.50  1.20000
##   Tetrahydrocortisone Pregnanetriol
## a            2.966667          2.44
## b            8.180000          1.12
## c           19.720000          5.50
## u           14.016667          1.20
## Warning: All elements of `...` must be named.
## Did you want `data = c(Tetrahydrocortisone, Pregnanetriol)`?