Challenge 3

Author

Gauri Naik

Published

April 8, 2023

Challenge_3

Dataset: eggs_tidy.csv

month year large_half_dozen large_dozen extra_large_half_dozen extra_large_dozen
January 2004 126.0 230.000 132.0 230.0
February 2004 128.5 226.250 134.5 230.0
March 2004 131.0 225.000 137.0 230.0
April 2004 131.0 225.000 137.0 234.5
May 2004 131.0 225.000 137.0 236.0
June 2004 133.5 231.375 137.0 241.0

Here we have the first six rows of six columns of data. It gives us the month, year, and prices of eggs based on size and amount.

Description of Dataset

Let’s figure out how large the dataframe actually is.

[1] 120
[1] 6

We have found that the data frame gives us 120 rows and 6 columns.

[1] "character"
[1] "integer"
[1] "double"

In the respective columns month, year, and large_half_dozen, the type of data are characters, integers, and doubles. And the type doubles extends across several columns.

Pivot and Table

Now we clean it up a bit and make it look nicer. We’re going to pivot the table so that we can more easily see the types of eggs and the quantity sold by month and year.

Month Year Size Quantity Prize
January 2004 large half_dozen 126.000
January 2004 large dozen 230.000
January 2004 extra_large half_dozen 132.000
January 2004 extra_large dozen 230.000
February 2004 large half_dozen 128.500
February 2004 large dozen 226.250
February 2004 extra_large half_dozen 134.500
February 2004 extra_large dozen 230.000
March 2004 large half_dozen 131.000
March 2004 large dozen 225.000
March 2004 extra_large half_dozen 137.000
March 2004 extra_large dozen 230.000
April 2004 large half_dozen 131.000
April 2004 large dozen 225.000
April 2004 extra_large half_dozen 137.000
April 2004 extra_large dozen 234.500
May 2004 large half_dozen 131.000
May 2004 large dozen 225.000
May 2004 extra_large half_dozen 137.000
May 2004 extra_large dozen 236.000
June 2004 large half_dozen 133.500
June 2004 large dozen 231.375
June 2004 extra_large half_dozen 137.000
June 2004 extra_large dozen 241.000
July 2004 large half_dozen 133.500
July 2004 large dozen 233.500
July 2004 extra_large half_dozen 137.000
July 2004 extra_large dozen 241.000
August 2004 large half_dozen 133.500
August 2004 large dozen 233.500
August 2004 extra_large half_dozen 137.000
August 2004 extra_large dozen 241.000
September 2004 large half_dozen 129.750
September 2004 large dozen 233.500
September 2004 extra_large half_dozen 135.875
September 2004 extra_large dozen 241.000
October 2004 large half_dozen 128.500
October 2004 large dozen 233.500
October 2004 extra_large half_dozen 135.500
October 2004 extra_large dozen 241.000
November 2004 large half_dozen 128.500
November 2004 large dozen 233.500
November 2004 extra_large half_dozen 135.500
November 2004 extra_large dozen 241.000
December 2004 large half_dozen 128.500
December 2004 large dozen 233.500
December 2004 extra_large half_dozen 135.500
December 2004 extra_large dozen 241.000
January 2005 large half_dozen 128.500
January 2005 large dozen 233.500
January 2005 extra_large half_dozen 135.500
January 2005 extra_large dozen 241.000
February 2005 large half_dozen 128.500
February 2005 large dozen 233.500
February 2005 extra_large half_dozen 135.500
February 2005 extra_large dozen 241.000
March 2005 large half_dozen 128.500
March 2005 large dozen 233.500
March 2005 extra_large half_dozen 135.500
March 2005 extra_large dozen 241.000
April 2005 large half_dozen 128.500
April 2005 large dozen 233.500
April 2005 extra_large half_dozen 135.500
April 2005 extra_large dozen 241.000
May 2005 large half_dozen 128.500
May 2005 large dozen 233.500
May 2005 extra_large half_dozen 135.500
May 2005 extra_large dozen 241.000
June 2005 large half_dozen 128.500
June 2005 large dozen 233.500
June 2005 extra_large half_dozen 135.500
June 2005 extra_large dozen 241.000
July 2005 large half_dozen 128.500
July 2005 large dozen 233.500
July 2005 extra_large half_dozen 135.500
July 2005 extra_large dozen 241.000
August 2005 large half_dozen 128.500
August 2005 large dozen 233.500
August 2005 extra_large half_dozen 135.500
August 2005 extra_large dozen 241.000
September 2005 large half_dozen 128.500
September 2005 large dozen 233.500
September 2005 extra_large half_dozen 135.500
September 2005 extra_large dozen 241.000
October 2005 large half_dozen 128.500
October 2005 large dozen 233.500
October 2005 extra_large half_dozen 135.500
October 2005 extra_large dozen 241.000
November 2005 large half_dozen 128.500
November 2005 large dozen 233.500
November 2005 extra_large half_dozen 135.500
November 2005 extra_large dozen 241.000
December 2005 large half_dozen 128.500
December 2005 large dozen 233.500
December 2005 extra_large half_dozen 135.500
December 2005 extra_large dozen 241.000
January 2006 large half_dozen 128.500
January 2006 large dozen 233.500
January 2006 extra_large half_dozen 135.500
January 2006 extra_large dozen 241.000
February 2006 large half_dozen 128.500
February 2006 large dozen 233.500
February 2006 extra_large half_dozen 135.500
February 2006 extra_large dozen 241.000
March 2006 large half_dozen 128.500
March 2006 large dozen 233.500
March 2006 extra_large half_dozen 135.500
March 2006 extra_large dozen 241.375
April 2006 large half_dozen 128.500
April 2006 large dozen 233.500
April 2006 extra_large half_dozen 135.500
April 2006 extra_large dozen 241.500
May 2006 large half_dozen 128.500
May 2006 large dozen 233.500
May 2006 extra_large half_dozen 135.500
May 2006 extra_large dozen 241.500
June 2006 large half_dozen 128.500
June 2006 large dozen 233.500
June 2006 extra_large half_dozen 135.500
June 2006 extra_large dozen 241.500
July 2006 large half_dozen 128.500
July 2006 large dozen 233.500
July 2006 extra_large half_dozen 135.500
July 2006 extra_large dozen 241.500
August 2006 large half_dozen 128.500
August 2006 large dozen 233.500
August 2006 extra_large half_dozen 135.500
August 2006 extra_large dozen 241.500
September 2006 large half_dozen 128.500
September 2006 large dozen 233.500
September 2006 extra_large half_dozen 135.500
September 2006 extra_large dozen 241.500
October 2006 large half_dozen 128.500
October 2006 large dozen 233.500
October 2006 extra_large half_dozen 135.500
October 2006 extra_large dozen 241.500
November 2006 large half_dozen 128.500
November 2006 large dozen 233.500
November 2006 extra_large half_dozen 135.500
November 2006 extra_large dozen 241.500
December 2006 large half_dozen 128.500
December 2006 large dozen 233.500
December 2006 extra_large half_dozen 135.500
December 2006 extra_large dozen 241.500
January 2007 large half_dozen 128.500
January 2007 large dozen 233.500
January 2007 extra_large half_dozen 135.500
January 2007 extra_large dozen 241.500
February 2007 large half_dozen 131.125
February 2007 large dozen 236.125
February 2007 extra_large half_dozen 138.125
February 2007 extra_large dozen 244.125
March 2007 large half_dozen 132.000
March 2007 large dozen 237.000
March 2007 extra_large half_dozen 139.000
March 2007 extra_large dozen 245.000
April 2007 large half_dozen 132.000
April 2007 large dozen 237.000
April 2007 extra_large half_dozen 139.000
April 2007 extra_large dozen 245.000
May 2007 large half_dozen 132.000
May 2007 large dozen 237.000
May 2007 extra_large half_dozen 139.000
May 2007 extra_large dozen 245.000
June 2007 large half_dozen 132.000
June 2007 large dozen 237.000
June 2007 extra_large half_dozen 139.000
June 2007 extra_large dozen 245.000
July 2007 large half_dozen 132.000
July 2007 large dozen 237.000
July 2007 extra_large half_dozen 139.000
July 2007 extra_large dozen 245.000
August 2007 large half_dozen 132.000
August 2007 large dozen 237.000
August 2007 extra_large half_dozen 139.000
August 2007 extra_large dozen 245.000
September 2007 large half_dozen 132.000
September 2007 large dozen 237.000
September 2007 extra_large half_dozen 139.000
September 2007 extra_large dozen 245.000
October 2007 large half_dozen 132.000
October 2007 large dozen 237.000
October 2007 extra_large half_dozen 139.000
October 2007 extra_large dozen 245.000
November 2007 large half_dozen 132.000
November 2007 large dozen 237.000
November 2007 extra_large half_dozen 139.000
November 2007 extra_large dozen 245.000
December 2007 large half_dozen 132.000
December 2007 large dozen 237.000
December 2007 extra_large half_dozen 139.000
December 2007 extra_large dozen 245.000
January 2008 large half_dozen 132.000
January 2008 large dozen 237.000
January 2008 extra_large half_dozen 139.000
January 2008 extra_large dozen 245.000
February 2008 large half_dozen 132.000
February 2008 large dozen 237.000
February 2008 extra_large half_dozen 139.000
February 2008 extra_large dozen 245.000
March 2008 large half_dozen 132.000
March 2008 large dozen 237.000
March 2008 extra_large half_dozen 139.000
March 2008 extra_large dozen 245.000
April 2008 large half_dozen 132.000
April 2008 large dozen 237.000
April 2008 extra_large half_dozen 139.000
April 2008 extra_large dozen 245.000
May 2008 large half_dozen 132.000
May 2008 large dozen 237.000
May 2008 extra_large half_dozen 139.000
May 2008 extra_large dozen 245.000
June 2008 large half_dozen 174.500
June 2008 large dozen 277.500
June 2008 extra_large half_dozen 185.500
June 2008 extra_large dozen 285.500
July 2008 large half_dozen 174.500
July 2008 large dozen 277.500
July 2008 extra_large half_dozen 185.500
July 2008 extra_large dozen 285.500
August 2008 large half_dozen 174.500
August 2008 large dozen 277.500
August 2008 extra_large half_dozen 185.500
August 2008 extra_large dozen 285.500
September 2008 large half_dozen 174.500
September 2008 large dozen 277.500
September 2008 extra_large half_dozen 185.500
September 2008 extra_large dozen 285.500
October 2008 large half_dozen 174.500
October 2008 large dozen 277.500
October 2008 extra_large half_dozen 185.500
October 2008 extra_large dozen 285.500
November 2008 large half_dozen 174.500
November 2008 large dozen 277.500
November 2008 extra_large half_dozen 185.500
November 2008 extra_large dozen 285.500
December 2008 large half_dozen 174.500
December 2008 large dozen 277.500
December 2008 extra_large half_dozen 185.500
December 2008 extra_large dozen 285.500
January 2009 large half_dozen 174.500
January 2009 large dozen 277.500
January 2009 extra_large half_dozen 185.500
January 2009 extra_large dozen 285.500
February 2009 large half_dozen 174.500
February 2009 large dozen 277.500
February 2009 extra_large half_dozen 185.500
February 2009 extra_large dozen 285.500
March 2009 large half_dozen 174.500
March 2009 large dozen 277.500
March 2009 extra_large half_dozen 185.500
March 2009 extra_large dozen 285.500
April 2009 large half_dozen 174.500
April 2009 large dozen 277.500
April 2009 extra_large half_dozen 185.500
April 2009 extra_large dozen 285.500
May 2009 large half_dozen 174.500
May 2009 large dozen 277.500
May 2009 extra_large half_dozen 185.500
May 2009 extra_large dozen 285.500
June 2009 large half_dozen 174.500
June 2009 large dozen 277.500
June 2009 extra_large half_dozen 185.500
June 2009 extra_large dozen 285.500
July 2009 large half_dozen 174.500
July 2009 large dozen 277.500
July 2009 extra_large half_dozen 185.500
July 2009 extra_large dozen 285.500
August 2009 large half_dozen 174.500
August 2009 large dozen 271.500
August 2009 extra_large half_dozen 185.500
August 2009 extra_large dozen 285.500
September 2009 large half_dozen 174.500
September 2009 large dozen 271.500
September 2009 extra_large half_dozen 185.500
September 2009 extra_large dozen 285.500
October 2009 large half_dozen 174.500
October 2009 large dozen 271.500
October 2009 extra_large half_dozen 185.500
October 2009 extra_large dozen 285.500
November 2009 large half_dozen 174.500
November 2009 large dozen 271.500
November 2009 extra_large half_dozen 185.500
November 2009 extra_large dozen 285.500
December 2009 large half_dozen 174.500
December 2009 large dozen 271.500
December 2009 extra_large half_dozen 185.500
December 2009 extra_large dozen 285.500
January 2010 large half_dozen 174.500
January 2010 large dozen 271.500
January 2010 extra_large half_dozen 185.500
January 2010 extra_large dozen 285.500
February 2010 large half_dozen 174.500
February 2010 large dozen 271.500
February 2010 extra_large half_dozen 185.500
February 2010 extra_large dozen 285.500
March 2010 large half_dozen 174.500
March 2010 large dozen 268.000
March 2010 extra_large half_dozen 185.500
March 2010 extra_large dozen 285.500
April 2010 large half_dozen 174.500
April 2010 large dozen 268.000
April 2010 extra_large half_dozen 185.500
April 2010 extra_large dozen 285.500
May 2010 large half_dozen 174.500
May 2010 large dozen 268.000
May 2010 extra_large half_dozen 185.500
May 2010 extra_large dozen 285.500
June 2010 large half_dozen 174.500
June 2010 large dozen 268.000
June 2010 extra_large half_dozen 185.500
June 2010 extra_large dozen 285.500
July 2010 large half_dozen 174.500
July 2010 large dozen 268.000
July 2010 extra_large half_dozen 185.500
July 2010 extra_large dozen 285.500
August 2010 large half_dozen 174.500
August 2010 large dozen 268.000
August 2010 extra_large half_dozen 185.500
August 2010 extra_large dozen 285.500
September 2010 large half_dozen 174.500
September 2010 large dozen 268.000
September 2010 extra_large half_dozen 185.500
September 2010 extra_large dozen 285.500
October 2010 large half_dozen 174.500
October 2010 large dozen 267.500
October 2010 extra_large half_dozen 185.500
October 2010 extra_large dozen 285.500
November 2010 large half_dozen 174.500
November 2010 large dozen 267.500
November 2010 extra_large half_dozen 185.500
November 2010 extra_large dozen 285.500
December 2010 large half_dozen 174.500
December 2010 large dozen 267.500
December 2010 extra_large half_dozen 185.500
December 2010 extra_large dozen 285.500
January 2011 large half_dozen 174.500
January 2011 large dozen 267.500
January 2011 extra_large half_dozen 185.500
January 2011 extra_large dozen 285.500
February 2011 large half_dozen 174.500
February 2011 large dozen 267.500
February 2011 extra_large half_dozen 185.500
February 2011 extra_large dozen 285.500
March 2011 large half_dozen 174.500
March 2011 large dozen 267.500
March 2011 extra_large half_dozen 185.500
March 2011 extra_large dozen 285.500
April 2011 large half_dozen 174.500
April 2011 large dozen 267.500
April 2011 extra_large half_dozen 185.500
April 2011 extra_large dozen 285.500
May 2011 large half_dozen 174.500
May 2011 large dozen 267.500
May 2011 extra_large half_dozen 185.500
May 2011 extra_large dozen 285.500
June 2011 large half_dozen 174.500
June 2011 large dozen 270.000
June 2011 extra_large half_dozen 185.500
June 2011 extra_large dozen 285.500
July 2011 large half_dozen 174.500
July 2011 large dozen 270.000
July 2011 extra_large half_dozen 185.500
July 2011 extra_large dozen 285.500
August 2011 large half_dozen 174.500
August 2011 large dozen 270.000
August 2011 extra_large half_dozen 185.500
August 2011 extra_large dozen 285.500
September 2011 large half_dozen 174.500
September 2011 large dozen 270.000
September 2011 extra_large half_dozen 185.500
September 2011 extra_large dozen 285.500
October 2011 large half_dozen 174.500
October 2011 large dozen 270.000
October 2011 extra_large half_dozen 185.500
October 2011 extra_large dozen 285.500
November 2011 large half_dozen 174.500
November 2011 large dozen 270.000
November 2011 extra_large half_dozen 185.500
November 2011 extra_large dozen 285.500
December 2011 large half_dozen 174.500
December 2011 large dozen 270.000
December 2011 extra_large half_dozen 185.500
December 2011 extra_large dozen 285.500
January 2012 large half_dozen 174.500
January 2012 large dozen 267.500
January 2012 extra_large half_dozen 185.500
January 2012 extra_large dozen 285.500
February 2012 large half_dozen 174.500
February 2012 large dozen 267.500
February 2012 extra_large half_dozen 185.500
February 2012 extra_large dozen 288.500
March 2012 large half_dozen 174.500
March 2012 large dozen 267.500
March 2012 extra_large half_dozen 185.500
March 2012 extra_large dozen 288.500
April 2012 large half_dozen 174.500
April 2012 large dozen 267.500
April 2012 extra_large half_dozen 185.500
April 2012 extra_large dozen 288.500
May 2012 large half_dozen 173.250
May 2012 large dozen 267.500
May 2012 extra_large half_dozen 185.500
May 2012 extra_large dozen 288.500
June 2012 large half_dozen 173.250
June 2012 large dozen 267.500
June 2012 extra_large half_dozen 185.500
June 2012 extra_large dozen 288.500
July 2012 large half_dozen 173.250
July 2012 large dozen 267.500
July 2012 extra_large half_dozen 185.500
July 2012 extra_large dozen 288.500
August 2012 large half_dozen 173.250
August 2012 large dozen 267.500
August 2012 extra_large half_dozen 185.500
August 2012 extra_large dozen 288.500
September 2012 large half_dozen 173.250
September 2012 large dozen 267.500
September 2012 extra_large half_dozen 185.500
September 2012 extra_large dozen 288.500
October 2012 large half_dozen 173.250
October 2012 large dozen 267.500
October 2012 extra_large half_dozen 185.500
October 2012 extra_large dozen 288.500
November 2012 large half_dozen 178.000
November 2012 large dozen 267.500
November 2012 extra_large half_dozen 188.130
November 2012 extra_large dozen 290.000
December 2012 large half_dozen 178.000
December 2012 large dozen 267.500
December 2012 extra_large half_dozen 188.130
December 2012 extra_large dozen 290.000
January 2013 large half_dozen 178.000
January 2013 large dozen 267.500
January 2013 extra_large half_dozen 188.130
January 2013 extra_large dozen 290.000
February 2013 large half_dozen 178.000
February 2013 large dozen 267.500
February 2013 extra_large half_dozen 188.130
February 2013 extra_large dozen 290.000
March 2013 large half_dozen 178.000
March 2013 large dozen 267.500
March 2013 extra_large half_dozen 188.130
March 2013 extra_large dozen 290.000
April 2013 large half_dozen 178.000
April 2013 large dozen 267.500
April 2013 extra_large half_dozen 188.130
April 2013 extra_large dozen 290.000
May 2013 large half_dozen 178.000
May 2013 large dozen 267.500
May 2013 extra_large half_dozen 188.130
May 2013 extra_large dozen 290.000
June 2013 large half_dozen 178.000
June 2013 large dozen 267.500
June 2013 extra_large half_dozen 188.130
June 2013 extra_large dozen 290.000
July 2013 large half_dozen 178.000
July 2013 large dozen 267.500
July 2013 extra_large half_dozen 188.130
July 2013 extra_large dozen 290.000
August 2013 large half_dozen 178.000
August 2013 large dozen 267.500
August 2013 extra_large half_dozen 188.130
August 2013 extra_large dozen 290.000
September 2013 large half_dozen 178.000
September 2013 large dozen 267.500
September 2013 extra_large half_dozen 188.130
September 2013 extra_large dozen 290.000
October 2013 large half_dozen 178.000
October 2013 large dozen 267.500
October 2013 extra_large half_dozen 188.130
October 2013 extra_large dozen 290.000
November 2013 large half_dozen 178.000
November 2013 large dozen 267.500
November 2013 extra_large half_dozen 188.130
November 2013 extra_large dozen 290.000
December 2013 large half_dozen 178.000
December 2013 large dozen 267.500
December 2013 extra_large half_dozen 188.130
December 2013 extra_large dozen 290.000
# A tibble: 480 × 4
   month     year size_quantity          price
   <chr>    <int> <chr>                  <dbl>
 1 January   2004 large half_dozen        126 
 2 January   2004 large dozen             230 
 3 January   2004 extra_large half_dozen  132 
 4 January   2004 extra_large dozen       230 
 5 February  2004 large half_dozen        128.
 6 February  2004 large dozen             226.
 7 February  2004 extra_large half_dozen  134.
 8 February  2004 extra_large dozen       230 
 9 March     2004 large half_dozen        131 
10 March     2004 large dozen             225 
# … with 470 more rows