Skip to content

Instantly share code, notes, and snippets.

@Mytherin
Created June 19, 2021 11:01
Show Gist options
  • Save Mytherin/1c0f206eb22ba3256d52356170710217 to your computer and use it in GitHub Desktop.
Save Mytherin/1c0f206eb22ba3256d52356170710217 to your computer and use it in GitHub Desktop.
duckdb R example
# install.packages("duckdb")
library(duckdb)
# open a connection to an in-memory database
db <- dbConnect(duckdb::duckdb())
# run a SELECT * query that reads from a CSV file at the specified path
df <- dbGetQuery(db, 'SELECT * FROM "test/sql/copy/csv/data/real/voter.tsv"')
head(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment