You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue relates to the manipulating, analysing and exporting data with tidyverse, specifically the split-apply-combine section.
Currently the text regarding the use of arrange() with multiple variables read "With the above code, we can proceed with arrange() to sort the table according to a number of criteria so that we have a better comparison. For instance, we might want to arrange the table above in (i) an alphabetical order of the levels of the species and (ii) in descending order of the count".
1 F albigula 675
2 M albigula 502
3 NA albigula 75
4 NA audubonii 75
5 F baileyi 1646
6 M baileyi 1216
7 NA baileyi 29
8 NA bilineata 303
9 NA brunneicapillus 50
10 NA chlorurus 39
Having run this code when reviewing this lesson, I was somewhat confused as to why the output table did not appear to have 'n' in descending order. After a few minutes of playing around, I realised that the descending order of 'n' was within the species - with species in alphabetical order. I think that additional clarity is needed in the text to emphasise the importance of the order in which variables are passed to arrange().
The text was updated successfully, but these errors were encountered:
Thanks @Charl-Hutchings for opening this issue. The lesson underwent a major update and reorganisation when #887 was merged. As your suggestion relates to content in a version of the lesson before that update took place, I will close it. Please open a new issue if you have suggestions for how the new content could be improved.
This issue relates to the manipulating, analysing and exporting data with tidyverse, specifically the split-apply-combine section.
Currently the text regarding the use of arrange() with multiple variables read "With the above code, we can proceed with arrange() to sort the table according to a number of criteria so that we have a better comparison. For instance, we might want to arrange the table above in (i) an alphabetical order of the levels of the species and (ii) in descending order of the count".
surveys %>%
count(sex, species) %>%
arrange(species, desc(n))
outputs...
A tibble: 81 × 3
sex species n
1 F albigula 675
2 M albigula 502
3 NA albigula 75
4 NA audubonii 75
5 F baileyi 1646
6 M baileyi 1216
7 NA baileyi 29
8 NA bilineata 303
9 NA brunneicapillus 50
10 NA chlorurus 39
Having run this code when reviewing this lesson, I was somewhat confused as to why the output table did not appear to have 'n' in descending order. After a few minutes of playing around, I realised that the descending order of 'n' was within the species - with species in alphabetical order. I think that additional clarity is needed in the text to emphasise the importance of the order in which variables are passed to arrange().
The text was updated successfully, but these errors were encountered: