Referenced from lesson Grouped Samples

Use method chaining to define the grouped samples below, using the helper functions that you’ve already defined: is-old, is-young, is-cat, is-dog, is-female, lookup-fixed, and has-s-name. We’ve given you the solution for the first sample, to get you started.

Subset The code to define that subset

Kittens

kittens = animals-table.filter(is-cat).filter(is-young)

Puppies

young-dogs = animals-table.

Fixed Cats

fixed-cats = animals-table.

Cats with “s” in their name

s-cats = animals-table.

Old Dogs

old = animals-table.

Fixed Animals

fixed = animals-table.

Old Female Cats

old-cats = animals-table.

Fixed Kittens

young-fixed-cats = animals-table.

Fixed Female Dogs

fixed-female-dogs = animals-table.

Old Fixed Female Cats

old-fixed-female-cats = animals-table.

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Data Science by Emmanuel Schanzer, Nancy Pfenning, Emma Youndtsmith, Jennifer Poole, Shriram Krishnamurthi, Joe Politz, Ben Lerner, Flannery Denny, and Dorai Sitaram with help from Eric Allatta and Joy Straub is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.