Student please help

I have been working on this error for hours. What am I doing wrong?

Q4 - National average

How does our state compare to the national average in terms of interoperability?

TODO: Sourcing ds1, print a table containing national compliance proportion.

d2e<- ds1 %>% 
  group_by(interoperable)  %>% 
  dplyr::summarize(n_hospitals = n ()) %>% 
  dplyr::mutate(prop_hospitals = scales:: number(n_hospitals/sum(n_hospitals), accuracy -0.001)) %>% 
  dplyr::mutate(pct_hospitals = scales:: percent(n_hospitals/sum(n_hospitals), decimal.mark = ",", accuracy -0.01))
d2e %>%  print()
Here is the error.
Error: Problem with `mutate()` input `prop_hospitals`.
x object 'accuracy' not found
ℹ Input `prop_hospitals` is `scales::number(n_hospitals/sum(n_hospitals), accuracy - 0.001)`.
Run `rlang::last_error()` to see where the error occurred.
>   d2e %>%  print()
Error in eval(lhs, parent, parent) : object 'd2e' not found

Looks like you just need accuracy = 0.001 and instead you have a minus sign (in two places)

If that doesn’t fix your error, you should make a reprex to get better help.

Please have a look at this guide, to see how to create one:

Thank you so much. I appreciate your help. I have been working on this for hours.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.