You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the error below when trying to run harmo_process, which was resolved by converting the input dataset into a tibble. However, it was unclear from the error message and traceback where the issue came from. The class of the original input dataset was "data.frame" (instead of ""tbl_df" "tbl" "data.frame"). When I ran the is_dataset function, it returned TRUE so I initially thought that the problem was with other processing elements and not the dataset.
The text was updated successfully, but these errors were encountered:
The dataset is on an external server so I can't share it, but I can send a summary report if that helps. I'm not sure if it's actually the class causing the problem, I've run harmo_process with other datasets of class "data.frame" and those still worked without any issues.
hello @zchenmr. I think I found the problem, which might not be due to the package.
In a nutshell, across() function from dplyr, and widely used in the package does not work with the grouping variable.
# does not work and throw an error
iris %>% group_by(Species) %>% mutate(across(Species,as.character))
# does not work but silently bypass Species (everything is coerced into a character, except Species)
iris %>% group_by(Species) %>% mutate(across(everything(),as.character))
# does work
iris %>% group_by(Species) %>% mutate(Species = as.character(Species))
I'll check across the package when the dataset is grouped and ensure it is ungroup() before
@
GuiFabre
added a commit
to maelstrom-research/madshapR
that referenced
this issue
Nov 24, 2024
I got the error below when trying to run
harmo_process
, which was resolved by converting the input dataset into a tibble. However, it was unclear from the error message and traceback where the issue came from. The class of the original input dataset was "data.frame" (instead of ""tbl_df" "tbl" "data.frame"). When I ran theis_dataset
function, it returned TRUE so I initially thought that the problem was with other processing elements and not the dataset.The text was updated successfully, but these errors were encountered: