collapse icon indicating copy to clipboard operation
collapse copied to clipboard

Inconsistent results with fmutate

Open romu545 opened this issue 1 year ago • 1 comments

Greetings. I have the following problem with fmutate. When using arguments other than "all" for a row-0 dataframe, the function removes the 'names' attribute. What do you recommend? I need the names to be preserved both for cases in which records exist and for those in which they do not. Thanks, I'll be waiting!

Example: `

CON COLLAPSE

iris |> fsubset(Petal.Length > 100) |> fmutate("variable" = Species, .keep = "none") |> attributes()

CON DPLYR

iris |> fsubset(Petal.Length > 100) |> mutate("variable" = Species, .keep = "none") |> attributes() `

romu545 avatar Aug 22 '24 01:08 romu545

Thanks. This is a bit difficult to fix the way fmutate() is currently constructed, basically the .keep argument calls a function which also removes empty/NULL columns. However, you can use function fcompute() instead here to get the desired result.

SebKrantz avatar Sep 07 '24 11:09 SebKrantz

Gracias, Ha sido una limitante que algunas de las funciones de collapse generen error con 'Dataframes' con cero filas o vacíos.

romu545 avatar Oct 31 '24 13:10 romu545