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

Possible improvements to the tableinfo dataset #9

Closed
tylerlittlefield opened this issue May 10, 2021 · 0 comments
Closed

Possible improvements to the tableinfo dataset #9

tylerlittlefield opened this issue May 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@tylerlittlefield
Copy link
Member

The tableinfo dataset is pretty much a raw representation of the tables found at each individual link shown here: https://exoplanetarchive.ipac.caltech.edu/docs/TAP/usingTAP.html

There could be some possible areas of improvement such as replacing "X" with TRUE, i.e. something more familiar to R users. Below are some ideas:

library(dplyr)

tableinfo %>% 
  # remove all trailing/leading whitespace
  mutate(across(
    .cols = where(is.character), 
    .fns = stringr::str_squish
  )) %>% 
  # replace all empty character values with NA
  mutate(across(
    .cols = where(is.character), 
    .fns = dplyr::na_if, 
    ""
  )) %>% 
  # if "X" return TRUE
  mutate(across(
    .cols = where(is.character), 
    .fns = ~ ifelse(
      test = .x == "X", 
      yes = TRUE, 
      no = .x
    )
  ))
@tylerlittlefield tylerlittlefield added the enhancement New feature or request label May 10, 2021
tylerlittlefield pushed a commit that referenced this issue May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant