Hi Thanks for the response,
Not sure what else I can provide, here is the sample snippet of the line I am trying to execute
var1 <- var %>% group_by(abc, Year) %>% summarise(S=sum(S, na.rm = T), L=sum(L, na.rm = T),C=sum(C, na.rm = T),L_C=sum(L_C, na.rm = T),L_D=sum(L_D, na.rm = T)) %>% data.frame() %>%
+ mutate(Rank1=FUN.Rank_New(L, Type=RankType),
+ Rank1Percentile=FUN.Rank_0_100_New(Loss, Type=RankType),
+ GScore=FUN_Score_1_3(GRnkPercentile)) %>% arrange(GRank) %>% data.frame()
`summarise()` has grouped output by 'T'. You can override using the `.groups` argument.
Error: Problem with `mutate()` column `GScore`.
i `GScore = FUN_Score_1_3(GRnkPercentile)`.
x invalid 'labels'; length 3 should be 1 or 0
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
Problem with `mutate()` column `GRnkPercentile`.
i `GRnkPercentile = FUN.Rank_0_100_New(L, Type = RankType)`.
i no non-missing arguments to max; returning -Inf
Called from: signal_abort(cnd)
First, here is a guide you can read about how to provide a minimal reproducible example.
Your error seems to relate to what would appear to be a custom function. (i.e., we can't know what it is, or how it works if you don't provide us that information...) Its returning a result with dimensions that don't fit the data.frame structure expectations. One way to proceed might be to naively capture its results into a list, though this can make for difficult programming. Another way would be to understand the function and to use it (or decide not to use it, but to use something else ) based on its appropriateness for the task.
Thanks @nirgrahamuk and yifanliu alot for your inputs, I will consider them and will try to implement in other ways, Also will try to produce a reproducible code and share it.