Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newest version of dplyr (1.1) requires code changes #48

Open
nohelix opened this issue Feb 28, 2023 · 6 comments
Open

Newest version of dplyr (1.1) requires code changes #48

nohelix opened this issue Feb 28, 2023 · 6 comments

Comments

@nohelix
Copy link
Collaborator

nohelix commented Feb 28, 2023

In dplyr 1.1.0 main fails due to line 316's left_join argument all.x = TRUE
trial_data = dplyr::left_join(x = trial_data_encoded, y = dplyr::select(run_properties$stim_encoding_table, -Repeat_number, -``Delay (s)``), by = "Stim_ID", all.x = TRUE)

It works on the prior 1.0.10 version of dplyr.

In the newer 1.1 version, you get the fatal error:

Error in dplyr::left_join(x = trial_data_encoded, y = dplyr::select(run_properties$stim_encoding_table, :
... must be empty.
✖ Problematic argument:
• all.x = TRUE

If you remove the all.x = TRUE argument, the file processes with the additional warnings:

Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
ℹ Please use reframe() instead.
ℹ When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped data frame and
adjust accordingly.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
ℹ Please use reframe() instead.
ℹ When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped data frame and
adjust accordingly.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
Analysis type: BBN Mixed Duration
Warning in left_join(need_evaluation, r, by = groupings) :
Each row in x is expected to match at most 1 row in y.
ℹ Row 1 of x matches multiple rows.
ℹ If multiple matches are expected, set multiple = "all" to silence this warning.

@nohelix nohelix added bug Something isn't working priority: high labels Feb 28, 2023
@nohelix
Copy link
Collaborator Author

nohelix commented Feb 28, 2023

I have tried to roll back the computer experiencing these issues to 1.0.10 but it fails to build correctly.

In the mean time, I am not allowing UGs to use that computer

@nohelix
Copy link
Collaborator Author

nohelix commented Feb 28, 2023

From tidyverse/dplyr#6262 or lionel-/lillies@6d0d31f

Don't supply all.x to left_join()
This is not an actual argument of left_join() and it is now stricter in what it accepts

nohelix added a commit that referenced this issue Mar 7, 2023
the all.x was apparently never doing anything and causes a critical failure in dplyr 1.1. Paritally addresses #48. However, code is still not ready for new dplyr due to changes in group_by, summarise and the new reframe. See https://dplyr.tidyverse.org/news/index.html
@nohelix nohelix added priority: low and removed bug Something isn't working priority: high labels Mar 7, 2023
@nohelix
Copy link
Collaborator Author

nohelix commented Mar 7, 2023

I have managed to install the old version of dply on all the lab computers so I made this low priority.

https://dplyr.tidyverse.org/news/index.html

Changes I know will affect the code:

  • transmute() is superseded in favour of mutate(.keep = "none")
  • [case_when()] should now have .default = NULL that should replace TRUE ~
  • lines 1092 to 1103 I believe we just need to add the multiple = "all" but need to double check that its expected that there are more than 1 row mach in the 2 tables
  • if its expected that we should get a 1 row table, replace summarise with reframe. This may apply more generally when we expect summarise to change the number of rows

@nohelix nohelix changed the title Newest version of dplyr appears to break left join on line 316 Newest version of dplyr (1.1) requires code changes Mar 7, 2023
@tofof
Copy link
Collaborator

tofof commented Apr 4, 2023

The all.x is fixed by 4be52ce. The summarize/reframe issue is still outstanding.

@nohelix
Copy link
Collaborator Author

nohelix commented Aug 9, 2023

Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
i Please use reframe() instead.
i When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped data frame and adjust accordingly.

This can be caused by a blank table return.
run_archive.zip

Reproduce:
Blue1 on 8/9/23 in supervisor-custom
line 598 (df_Rxn) returns a blank table at:
r %>% unnest(reaction) %>% dplyr::filter(task != "TH" & Dur (ms)== duration_current &Inten (dB) %in% c(55,65))
resulting in this warning.

nohelix added a commit that referenced this issue Jan 26, 2024
nohelix added a commit that referenced this issue Jan 26, 2024
Addresses part of #48
@nohelix
Copy link
Collaborator Author

nohelix commented Jan 27, 2024

Still Happening in Main so haven't closed yet:

Loading file... C:\Users\Noelle\AppData\Local\Temp\RtmpknhrcR/86765e9c027e6ce4c27df80c/0.mat
Stim file: BBN_20-80dB_100ms_8s
Trials: 473 Hit%: 84.3 FA%: 6.3
Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
ℹ Please use reframe() instead.
ℹ When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped data frame and adjust accordingly.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
Warning: Returning more (or less) than 1 row per summarise() group was deprecated in dplyr 1.1.0.
ℹ Please use reframe() instead.
ℹ When switching from summarise() to reframe(), remember that reframe() always returns an ungrouped data frame and adjust accordingly.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
Analysis type: BBN (Standard)
Calculated run statistics.
Filename checks complete.
Weight checks complete.
Warning in Check_Performance_Cutoffs() : Low hit rate: 84.3%

Performance checks complete.
Archiving Run... Trials... Rat...
Run 20240127112732_178.192998468876_1.92546067375806 of Orange1 (#315) added to archives (in environment ONLY).

Run 20240127112732_178.192998468876_1.92546067375806 of Orange1 (#315) saved to disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants