DEV Community

Mahesh K
Mahesh K

Posted on • Edited on

1

R Language : Connect to SQLite database

When you are developing scripts for R. You may get into scenarios where you have to access different type of databases.

SQLite being file level database, not a lot of people use it for big data storage or analysis specific storage. Then again there are some scenarios where you may get to access this database.

For example Android based apps and the services make use of the Sqlite more these days. And you may have to clean and read such data.

So here I want to show you how to connect to SQLite database using R programming language.

You can check out R language Connect to SQLite database tutorial for video instructions.

Here's the code example that you can check out. I am assuming that you are using RStudio for executing the code below.

library(RSQLite)

setwd("/sqlitedatafolder")
sqlite <- dbDriver("SQLite")
conn <- dbConnect(sqlite,"rlang_db.sqlite3")
Enter fullscreen mode Exit fullscreen mode

This example basically connects you with the database. From here onwards you can run further queries and process the data and visualize depending on your requirement.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay