Skip to contents

Fetch Exoplanets table

Usage

fetch_table(
  table,
  query_string = NULL,
  pretty_colnames = FALSE,
  format = "csv"
)

Arguments

table

A string specifying the table to query. Must be one of:

  • ps - Planetary Systems table

  • pscomppars – Planetary Systems Composite Parameters table

  • stellarhosts – Stellar Hosts table

  • keplernames – Kepler Confirmed Names

query_string

Optional ADQL WHERE clause as a string, e.g., pl_bmasse > 1 AND st_teff < 6000.

pretty_colnames

Optional bool value. If TRUE replaces database column names with their labels / descriptions. Defaults to FALSE. Currently only tables ps and pscomppars are supported.

format

Optional char value specifying output format. Can be either "csv" for data frame, or "json" for a named list.

Value

A data frame or named list containing fetched data.

Details

Fetches data from an exoplanets TAP (Table Access Protocol) service and returns it as a data frame or a named list. You can optionally specify WHERE ADQL clause to filter rows based on conditions.

Examples

if (FALSE) { # \dontrun{
 # All entries from Stellar Hosts table
 fetch_table("stellarhosts")
 # Entries from Planetary Systems table where planetary mass > 3 times the earth mass
 fetch_table("ps", query_string = "pl_bmasse > 3")
 # Planets orbiting Teegarden's Star with radius > 1 Earth radius
 fetch_table("pscomppars", query_string = "hostname = 'Teegarden''s Star' and pl_rade > 1")
} # }