Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for database with R [closed]

Tags:

database

r

I am using R to run simulations using time series data. I have been using arrays to store data but I need a less memory intensive solution for storing data at intermediate steps in order to document the process. I am not a programmer so I am looking for something relatively easy to setup on multiple platforms if possible (Windows, Mac, Linux). I also need to be able to directly call the database from R since learning another language is not feasible now. Ideally, I would like to be able to read and write frequently to the database in a manner similar to an array though I don't know if that is realistic. I will gladly sacrifice speed for ease of use but I am willing to work to learn open source solutions. Any suggestions would be appreciated.

like image 218
ProbablePattern Avatar asked Jul 16 '10 15:07

ProbablePattern


People also ask

How do databases treat the different data types in R?

We know of the different data types in R such as integer, numeric/double, logical, factor etc. How do databases treat these data types? To know the data type of a particular value in a database, use . The first input is the database driver and the next is the value whose data type we are seeking.

What is the best database interface for R?

DBI a database interface for R dbplyr a dplyr backend for databases dplyr for querying data dbplot & ggplot2 for data visualization modeldb & tidypredict for modeling & prediction inside database config for handling credentials If you do not have all the above packages installed, go ahead and install them.

How to load data from a database in R?

“dbSendQuery ()” is the function containing parameter for data load into R. It fetches the data using database connection through SQL query. “trainset_3” the class created in the first step, containing all the information of database connection. Here this imprints where the data needs to be taken.

What is R data set?

Once the data exists in the R environment, it becomes a normal R data set and can be controlled or analyzed using all efficient packages and functions. Data are Relational database systems which are kept in a structured format.


1 Answers

Quick comments:

  • R is good at this, as a language for programming with data, there are plenty of interfaces
  • There is an entire manual devoted to data import/export, and it has a section on relational databases, so start there.
  • R has the widely-used DBI package which provides a unified interface for many backends, among them SQLite, MySQL, PostgreSQL, Oracle, ... Use that, maybe with RSQLite to get something going quickly. You can still switch backends afterwards.
  • There is also RODBC but I find ODBC tedious to work with.
  • R also has a specialised variant in the TSdbi package by Paul Gilbert which brings the DBI-alike abstraction to timeseries databases. It also supports multiple backends.
  • The data.table package was written for this and is very fast on indexing and aggregation.
like image 94
Dirk Eddelbuettel Avatar answered Sep 28 '22 18:09

Dirk Eddelbuettel