After much frustration, I have written my own function to transpose Tibbles I've attempted to make it universal so I don't have to rewrite it in the future
Its purpose is a simple transpose like is possible in Excel special paste or t() for data frames its made for making tables that ill put in my publications that won't always follow the tidy principles
Would anyone be able to advice if there is any better way to write my function and also whats the best way for me to store this so I can access it quickly in the future? is it time for me to make my own package?
transpose_tibble<-function(tibble){
tibble%>%
rename(rowname=1)%>%
mutate(across(everything(),~as.character(.)))%>%
pivot_longer(cols = !rowname ,names_to = 'variable', values_to = 'value') %>%
pivot_wider(id_cols = variable, names_from = rowname, values_from = value)%>%
type.convert(as.is=TRUE)
}