79179708

Date: 2024-11-12 03:36:44
Score: 1
Natty:
Report link

Based on @Pokemoon comment, my solution might be more applicable

df <- df |> 
mutate(ID = case_when(V3=="INFO" ~ V4, .default = NA)) |> 
  tidyr::fill(ID) |>
  filter(V1 != "REF") |>
  rename(
    REF = V1,
    ALT = V2,
    INFO = V3,
    VAR = V4
  )

Edited to properly have default column names of V#.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Pokemoon
Posted by: gabagool