Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: yaml_to_df() can't handle spaces in tool names #40

Open
kelly-sovacool opened this issue Dec 1, 2023 · 0 comments
Open

docs: yaml_to_df() can't handle spaces in tool names #40

kelly-sovacool opened this issue Dec 1, 2023 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@kelly-sovacool
Copy link
Member

Spaces get converted to periods, which then break separate_wider_delim

yaml_to_df <- function(y) {
  dat <- as.data.frame(y) %>% t() %>% as.data.frame()
  dat['names'] <- rownames(dat)
  dat <- as_tibble(dat)
  dat %>%
    separate_wider_delim(names, '.', names = c('name', 'value')) %>%
    pivot_wider(names_from = value, values_from = V1)
}

See sort/bed GNU coreutils entry

@kelly-sovacool kelly-sovacool added bug Something isn't working documentation Improvements or additions to documentation labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant