Seattle Pets: Explained
This small project is a part of a weekly #TidyTuesday challenge. This time I will explore … Seattle pets.
My first question was - How many pets per zip code in Seattle?
In order to figure it out, I would like to merge a given dataset with data(zipcode) from zipcode package, using left_join(). It will allow to assign each zipcode to a specific GPS location
| zip_code | number | city | state | latitude | longitude |
|---|---|---|---|---|---|
| 98115 | 4744 | Seattle | WA | 47.68382 | -122.3012 |
| 98103 | 4500 | Seattle | WA | 47.67135 | -122.3417 |
| 98117 | 3871 | Seattle | WA | 47.68592 | -122.3784 |
| 98125 | 2879 | Seattle | WA | 47.71665 | -122.3031 |
| 98122 | 2518 | Seattle | WA | 47.61157 | -122.3041 |
| 98107 | 2453 | Seattle | WA | 47.66747 | -122.3747 |
Then I will visualize number of pets per zip code.
Then I would like to see if there any trends in owning cats vs dogs. I started from cats.
| zip_code | number | city | state | latitude | longitude |
|---|---|---|---|---|---|
| 98103 | 1655 | Seattle | WA | 47.67135 | -122.3417 |
| 98115 | 1626 | Seattle | WA | 47.68382 | -122.3012 |
| 98117 | 1344 | Seattle | WA | 47.68592 | -122.3784 |
| 98125 | 934 | Seattle | WA | 47.71665 | -122.3031 |
| 98122 | 931 | Seattle | WA | 47.61157 | -122.3041 |
| 98107 | 909 | Seattle | WA | 47.66747 | -122.3747 |
| zip_code | number | city | state | latitude | longitude |
|---|---|---|---|---|---|
| 98115 | 3111 | Seattle | WA | 47.68382 | -122.3012 |
| 98103 | 2845 | Seattle | WA | 47.67135 | -122.3417 |
| 98117 | 2524 | Seattle | WA | 47.68592 | -122.3784 |
| 98125 | 1939 | Seattle | WA | 47.71665 | -122.3031 |
| 98118 | 1754 | Seattle | WA | 47.54335 | -122.2750 |
| 98116 | 1660 | Seattle | WA | 47.57487 | -122.3939 |
I think it is obvious that people have more dogs in Seattle for some reason.
Now I would like to see how the registration went by month.
I start from converting data into more reliable format. From chr like November 16 2018 to int like Nov 2018.
| license_issue_date | species | number |
|---|---|---|
| Apr 2003 | Cat | 1 |
| Feb 2004 | Dog | 1 |
| Feb 2006 | Cat | 1 |
| Mar 2008 | Dog | 1 |
| Dec 2008 | Dog | 1 |
| Mar 2011 | Dog | 1 |
The chart will look like this:
As you can see, the active registering of pets in this dataset started after 2015, which raises questions what had happened before. I doubt that people did not have pets in Seattle before 2015? Maybe the city established new rules for such registration or something else?
Ok, let’s check data from 2015 only. BTW, I realized that there are not only cats and dogs in this datasets, but also pigs and goats(!!!). I noticed it, when I visualized data on a previous chart.
As you can see, dogs prevail. More interesting that the pattern of registration is the same for cats and dogs. Not sure why though.
Ok, everybody visualized cats and dogs and their popular names. I was curious about names of goats and pigs? Any pattern here?
| animals_name | species | number |
|---|---|---|
| NA | Pig | 1 |
| Abelard | Goat | 1 |
| Aggie | Goat | 1 |
| Arya | Goat | 1 |
| Atticus | Pig | 1 |
| Beans | Goat | 1 |
| Brussels Sprout | Goat | 1 |
| Coconut | Pig | 1 |
| Darcy | Goat | 1 |
| Darla | Pig | 1 |
| Fawn | Goat | 1 |
| Fiona | Goat | 1 |
| Gavin | Goat | 1 |
| Grace | Goat | 1 |
| Grayson | Goat | 1 |
| Heidi | Goat | 2 |
| Holly | Goat | 1 |
| Junebug | Goat | 1 |
| Lilac | Goat | 1 |
| Linda | Goat | 1 |
| Lula | Goat | 1 |
| Magnolia | Goat | 1 |
| Margot | Goat | 1 |
| Max | Goat | 1 |
| Millie | Pig | 1 |
| Moppet | Goat | 1 |
| Nani | Goat | 1 |
| Olive | Goat | 1 |
| Othello | Pig | 1 |
| Pegasis | Goat | 1 |
| Pepina | Goat | 1 |
| Phyllis | Goat | 1 |
| Piper | Goat | 1 |
| Professor Nibblesworth | Goat | 1 |
| Ramsey | Goat | 1 |
| Robuchon | Goat | 1 |
| Sassy | Goat | 1 |
| Sister Bertrille | Goat | 1 |
| Squiggie | Goat | 1 |
| Tacoma | Goat | 1 |
| Tati | Goat | 1 |
| Teddy | Goat | 1 |
| Truffle | Goat | 1 |
Which ones are your favorite? I love Brussels Sprout (goat), Coconut (pig), Othello (pig), Professor Nibblesworth (goat), and Sister Bertrille (pig). I was curious enough to google this Professor and found an article, but not such person.
Ok, let’s at least visualize the most popular names of pets, as everybody did. I will filter by names with at least 100 times.
It is interesting that so many cats are not registered with names. Why?
Conclusion
A pretty simple dataset, but still fun. I need a pig and I would call it Othello now.
Author’s Twitter: OleksiyAnokhin