swirldev / swirl_courses

:mortar_board: A collection of interactive courses for the swirl R package.
http://swirlstats.com
Other
4.25k stars 7.25k forks source link

Getting and Cleaning Data/Grouping and Chaining with dplyr : error when I submit script #521

Open C-P01 opened 1 year ago

C-P01 commented 1 year ago

Hi, When I follow this course and try to write code in the script following this :

Compute four values, in the following order, from

the grouped data:

#

1. count = n()

2. unique = n_distinct(ip_id)

3. countries = n_distinct(country)

4. avg_bytes = mean(size)

#

A few thing to be careful of:

#

1. Separate arguments by commas

2. Make sure you have a closing parenthesis

3. Check your spelling!

4. Store the result in pack_sum (for 'package summary')

#

You should also take a look at ?n and ?n_distinct, so

that you really understand what is going on.

pack_sum <- summarize(by_package, count = n(), unique = n_distinct(ip_id), countries = n_distinct(country), avg_bytes = mean(size))

I get this error when I submit() :

Error in is_data_pronoun(expr) : argument "expr" is missing, with no default

But I can't figure out what the problem is. Anyone can help me ?

Thank you !