Questions tagged [dbplyr]

dbplyr: A 'dplyr' Back End for Databases

A back end for databases that allows you to work with remote database tables as if they are in-memory data frames. Basic features works with any database that has a 'DBI' back end; more advanced features require 'SQL' translation to be provided by the package author.

377 questions
0
votes
1 answer

Can i apply facet_wrap or facet_grid with the dbplot package?

Im wondering if it´s possible to make a plot with the dbplot package and apply facet_grid or facet_wrap, im not sure if the package supports that or if im doing something wrong, here is the main idea that i…
0
votes
1 answer

How to filter by partition using dbplyr and BigQuery

I am connecting to BigQuery tables using dbplyr and the tables are partitioned, usually by date or time (the column is called _PARTITIONDATE or _PARTITIONTIME). In BigQuery, you can filter using the WHERE _PARTITIONDATE > "some date" to access…
mundos
  • 459
  • 6
  • 14
0
votes
3 answers

Count TRUE/FALSE values per row of a SQL table using dbplyr from R

I do have a remote connection to a SQL table using dbplyr. One of the table is composed of one ID column and several other columns storing 0 and 1 values (SQL bit - interpreted as boolean TRUE/FALSE values from R side) and from R I simply want to…
yeahman269
  • 705
  • 7
  • 16
0
votes
1 answer

left_join and dbplyr inefficient SQL

I'm pulling data from a number of different tables and joining them to a base table as shown below: df <- tbl(ch, dbplyr::in_schema("schem1", 'education_data')) %>% select(ID, ProviderKey,ReportingPeriodKey,EthnicityKey) %>% left_join( …
Gerard
  • 159
  • 1
  • 2
  • 11
0
votes
1 answer

R query on Oracle database where date is x days from today

I have connected to an oracle database using R, I can perform queries on it but I'm having a problem with performing queries on a date column. I want to get the rows where a certain date column (INLDATE) is ranged between today and 7 days from…
BillyBouw
  • 314
  • 2
  • 10
0
votes
1 answer

Retrieving Arabic data from Oracle database using R package

On querying a table from Oracle database that contains Arabic data, R is not able to encode correct characters. The following is an example of what I am trying to do: library(DBI) library(dplyr) #My local environment is set to…
Nareman Darwish
  • 1,251
  • 7
  • 14
0
votes
2 answers

Grouped correlation between two variables with dbplyr and corrr

I am connected with impala con <- DBI::dbConnect(odbc::odbc(), "impala connector", schema = "some_schema") library(dplyr) library(dbplyr) #I have to load both of them, if not tbl won't work table <- tbl(con, 'serverTable') I would like to…
goingdeep
  • 99
  • 1
  • 9
0
votes
1 answer

Shiny pass input into dbplyr filter pipe

I'm trying to use a textual input to filter a postgre table in a shiny dashboard. I need to filter a certain column that is selected from a selectinput. Problem is that column names of the table start with "_" i.e. "_7_track", so I have a lot of…
0
votes
0 answers

R SQLite database slow with multiple connections

I have an SQLite DB that I am using in a shiny app. My queries work quite quickly when there are only one person that has the connection to the DB open, however when there are more than one person it becomes quite slow. The table I am querying is…
0
votes
1 answer

Can I run a BigQuery SQL query and then continue wrangling the data using dbplyr?

In another project working with Amazon Athena I could do this: con <- DBI::dbConnect(odbc::odbc(), Driver = "path-to-driver", S3OutputLocation = "location", AwsRegion = "eu-west-1", AuthenticationType = "IAM…
0
votes
2 answers

Object 'sql_translate_env.Oracle' not found

My ROracle connection to Oracle 11.2g express has stopped functioning under R 4.0.4 with dbplyr_2.1.0 after an "updateR" "update.packages". The specific code…
0
votes
3 answers

Rolling mean, standard deviation in dbplyr

I want to set a new variable with rolling function (rolling mean, stdev...etc.) in dbplyr Here is a database library(odbc) library(DBI) library(tidyverse) library(zoo) con <- DBI::dbConnect(odbc::odbc(), Driver = "SQL…
Wookeun Lee
  • 463
  • 1
  • 6
  • 18
0
votes
1 answer

How to create non-clustered indexes for querying and collecting data from an SQLite DB in R for plotting?

I have a .csv file that contains 105M rows and 30 columns that I would like to query for plotting in an R shiny app. it contains alpha-numeric data that looks like: #Example data …
HCAI
  • 2,213
  • 8
  • 33
  • 65
0
votes
1 answer

Apply across rows in dbplyr (postgresql). Getting "Error: Unknown input type: pairlist"

I'm trying to filter on a condition that at least one of three columns has a value other than "". My code works on a data.frame (or tibble), but on a raw DBI table I get an error: Error: Unknown input type:…
abalter
  • 9,663
  • 17
  • 90
  • 145
0
votes
1 answer

Dbplyr: combine two tables and add the to the result to the database without loading them in memory

Please have a look at the simple script at the end of the post. I have a database containing two tables which I combine using union_all. Is there a way to add the result to the database without collecting the data i.e. loading them into memory? Many…
larry77
  • 1,309
  • 14
  • 29