Message-ID: <CAKZQJMDEcwUPnYg3tEy_Ch=PCWT2k69K=HSpr9iKbKL2zBLC2w@mail.gmail.com>
Date: 2020-02-01T14:55:23Z
From: John Kane
Subject: how to read a database in R?
In-Reply-To: <CAF9-5jPMRf7-im1FPE59dbhomi=v5v_kRLqc5vfYXrPTOCGtYg@mail.gmail.com>
Hi Ana
Stolen from https://gist.github.com/jwolfson/72bc7d7fd8d339955b38
I cannot remember if you will need to install any other packages besides
RSQLite
library(RSQLite)
filename <- "your_db_file.db"
sqlite.driver <- dbDriver("SQLite")
db <- dbConnect(sqlite.driver,
dbname = filename)
## Some operations
dbListTables(db)
mytable <- dbReadTable(db,"your_table_name"
Best of luck
On Sat, 1 Feb 2020 at 07:53, Ana Marija <sokovic.anamarija at gmail.com> wrote:
> Hi Ivan
>
> Thanks for getting back to me. Can you please share with me some code I
> would use to see what is in my database?
>
> On Sat, 1 Feb 2020 at 06:19, Ivan Krylov <krylov.r00t at gmail.com> wrote:
>
> > On Fri, 31 Jan 2020 17:02:16 -0600
> > Ana Marija <sokovic.anamarija at gmail.com> wrote:
> >
> > > I have a database DGN-WB_0.5.db is there is a way to explore its
> > > content in R?
> >
> > My psychic debugging powers tell me that it's an SQLite database, so
> > the answer to your question is: yes, it should be possible to both find
> > out the schema and run SQL queries on your file from R.
> >
> > --
> > Best regards,
> > Ivan
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
John Kane
Kingston ON Canada
[[alternative HTML version deleted]]