Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer review hw01 for garyzhub #1

Open
RetoSterchi opened this issue Sep 22, 2018 · 0 comments
Open

Peer review hw01 for garyzhub #1

RetoSterchi opened this issue Sep 22, 2018 · 0 comments

Comments

@RetoSterchi
Copy link

TOPIC Excellent Satisfactory Needs work Comments
Coding style ✔️   
Coding strategy ✔️     Straight forward exploration of the basic characteristics of the data set (variables, range, number of columns resp. rows etc.). See below for suggestions on doing the life expectancy calculation for 1952
Presentation: graphs ✔️    No graphs in the R code but creative use of graphs in the readme file
Presentation: tables ✔️     No tables in the R code but creative use of lists in the readme file
Achievement, creativity ✔️     Nice work on the readme file
Ease of access ✔️     Everything worked

Suggestions

The following code chunk is just another version of calculating the mean life expectancy in 1952. Compared to your strategy, it needs no 'post-processing' of the output (e.g., changing the names of columns etc.).

require(dplyr)

gapminder %>% 
  filter(year == 1952) %>% 
  group_by(continent, year) %>% 
  summarise(meanLifeExp = mean(lifeExp), 
            sumPop = sum(pop), 
            meanGDPPercap = mean(gdpPercap))

# here you can specify what should be done with each variables for the summary 
# (e.g., you might want to take the mean for the life expectancy but take the sum 
# of the population of every country)


# A tibble: 5 x 5
# Groups:   continent [?]
  continent  year meanLifeExp    sumPop meanGDPPercap
  <fct>     <int>       <dbl>     <dbl>         <dbl>
1 Africa     1952        39.1  4570010.         1253.
2 Americas   1952        53.3 13806098.         4079.
3 Asia       1952        46.3 42283556.         5195.
4 Europe     1952        64.4 13937362.         5661.
5 Oceania    1952        69.3  5343003         10298.

Cheers, Reto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant