Last answered:

19 Nov 2022

Posted on:

11 Nov 2022

0

The group_by() function Is Not Working

Here is the code:

library(dplyr)

star <- starwars

View(star)

star.species <- group_by(star, species)

View(star.species)

2 answers ( 0 marked as helpful)
Instructor
Posted on:

14 Nov 2022

0

Hi T. Serghides,
thanks for reaching out! Would you be able to provide a screenshot of the error message you're receiving when executing the code? Thanks in advance!

Best,
365 Eli

Posted on:

19 Nov 2022

0

Elitsa, Thank you for the reply.

> Would you be able to provide a screenshot of the error message you're
> receiving when executing the code? Thanks in advance!

The error can be seen when you compare the View(star) and the View(star.species).  The two View() functions give the same identical views and this leads to the conclusion that the dplyr group_by() function is not working.

star.species <- group_by(star, species)  #  This code does not work.

A Googled search reveals that this is a universal problem.  The group_by() function of dplyr is not
working.  Unless... I am missing something!

Again, Thank you for the reply.

Submit an answer