# 7-7 Exercise 3

# Create a sublist for animalType

AnimalType=list(Species=c("Dog",
                          "Dog",
                          "Dog",
                          "Cat",
                          "Cat"), 
                Breed=c("Greyhound",
                        "Staffordshire Bull Terrier",
                        "Italian Greyhound",
                        "Norwegian Forest",
                        "Norwegian Forest")
                )
# Create a list animals

Animals<-list(PetName=c("Gracie",
                        "Tilly",
                        "Ash",
                        "Thor",
                        "Heimdal"),
              Type=AnimalType,
              Age=c(14,18,4,6,5),
              Owner=c("Nusbacher",
                      "Louise",
                      "McKinnell",
                      "McKinnell",
                      "Thane-Clarke")
              )

# Display data

Animals



# Apply mean() to pet age

lapply(Animals[3],mean)




