I wrote a ton of queries in RMarkdown and trying to visualize results, but not sure how to convert my queries to dataframes.
# Libraries
library(RMySQL)
library(ggplot2)
library(dplyr)
library(DBI)
# Establish connection with the database
connection <- dbConnect(MySQL(), user = "user", password = "password",
dbname = "db", host = "localhost")
connection
# Sample query
test_query <- "SELECT first_name, last_name
FROM actor
LIMIT 5;"
dbGetQuery(connection, test_query)
My output works
Appreciate any tips