HW-2
##reading eggs_tidy dataset
month year large_half_dozen large_dozen extra_large_half_dozen
1 January 2004 126.0 230.000 132.0
2 February 2004 128.5 226.250 134.5
3 March 2004 131.0 225.000 137.0
4 April 2004 131.0 225.000 137.0
5 May 2004 131.0 225.000 137.0
6 June 2004 133.5 231.375 137.0
extra_large_dozen
1 230.0
2 230.0
3 230.0
4 234.5
5 236.0
6 241.0
str(eggs_tidy)
'data.frame': 120 obs. of 6 variables:
$ month : chr "January" "February" "March" "April" ...
$ year : int 2004 2004 2004 2004 2004 2004 2004 2004 2004 2004 ...
$ large_half_dozen : num 126 128 131 131 131 ...
$ large_dozen : num 230 226 225 225 225 ...
$ extra_large_half_dozen: num 132 134 137 137 137 ...
$ extra_large_dozen : num 230 230 230 234 236 ...
eggs_tidy_test<-select(eggs_tidy, month, large_half_dozen, year)
filter(eggs_tidy_test, month=="January", large_half_dozen>=131, year>2006) %>%
arrange(desc(year))
month large_half_dozen year
1 January 178.0 2013
2 January 174.5 2012
3 January 174.5 2011
4 January 174.5 2010
5 January 174.5 2009
6 January 132.0 2008
Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Pola (2022, May 19). Data Analytics and Computational Social Science: HW-2. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httprpubscomniharika901879/
BibTeX citation
@misc{pola2022hw-2, author = {Pola, Niharika}, title = {Data Analytics and Computational Social Science: HW-2}, url = {https://github.com/DACSS/dacss_course_website/posts/httprpubscomniharika901879/}, year = {2022} }