Skip to content

Instantly share code, notes, and snippets.

@jstet
jstet / exoplanets.R
Last active April 2, 2022 21:45
Scraped and processed the wikipedia list of potentially habitiable planets for visualization purposes. Names were randomly selected from wiki list of goddesses.
library(rvest)
library(dplyr)
library(jsonlite)
xpath <- "/html/body/div[3]/div[3]/div[5]/div[1]/table[2]"
url <- "https://en.wikipedia.org/wiki/List_of_potentially_habitable_exoplanets"
# Data Retrieval
exoplanets <- url %>%
{
"basics": {
"name": "Thomas Edison",
"label": "Inventor and Businessman",
"picture": "https://example.com/photo.jpg",
"email": "thomas.edison@example.com",
"phone": "(123) 456-7890",
"website": "https://thomasedison.com",
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.",
"location": {
{
"basics": {
"name": "Thomas Edison",
"label": "Inventor and Businessman",
"picture": "https://example.com/photo.jpg",
"email": "thomas.edison@example.com",
"phone": "(123) 456-7890",
"website": "https://thomasedison.com",
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.",
"location": {