mutate(across) error

I updated to 2023.03.1 Build 446, yesterday and found a few changes I needed to make to my code.

### the first was the count function, I changed it from.
mutate(count = n() to
mutate(count = dplyr::n()
### he second is, and I don't understand why is the across function.
mutate(across(starts_with("tr_sp_c"), round, 2))

the error I get is,

Error in mutate():
:information_source: In argument:
across(starts_with("tr_sp_c"), round, 2).
Caused by error in across():
! across() can only work inside of tidytable verbs

Backtrace:

  1. ├─... %>% mutate(across(starts_with("tr_sp_c"), round, 2))
  2. ├─dplyr::mutate(., across(starts_with("tr_sp_c"), round, 2))
  3. ├─dplyr:::mutate.data.frame(., across(starts_with("tr_sp_c"), round, 2))
  4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  5. │ ├─base::withCallingHandlers(...)
  6. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  7. │ └─mask$eval_all_mutate(quo)
  8. │ └─dplyr (local) eval()
  9. └─tidytable::across(starts_with("tr_sp_c"), round, 2)

I don't really understand why across isn't working like it had previously worked.

Were there major changes made in the new rstudio build. seems odd that the same code is now redundant for mine.

well it looks like there have been changes in tidytables, that affect a number of functions.

I was using tidytables as it was efficient with leads.

I had been and still do load a number of packages with pacman p_load.

I have now removed tidytables package from that and restructured the leads function I was running.

This topic was automatically closed 7 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.