I am trying to use RpostgreSQL to source data to be fed into the rpivotTable package and displayed to the user using shiny.
Error: data should be a data.frame, data.table, or table
Unfortunately I am new to R and I am unable to work out how to set…
I'm writing a query using RPostgreSQL meant to fill a table one time. I really have no intention to do anything else with the data within R. I just need it for is to run the function to fill that table.
library(data.table)
library (RPostgreSQL)
…
I am baffled why a simple query takes so long when executed through RPostgreSQL but completes almost instantly through another client. I have a Postgresql database ncol = 500 and nrow = 100. I would like to read the whole database into a dataframe…
Postgres has many convenient "backslash" commands (e.g \dt, \du, \l, etc). I would like to run these via the RPostgresql interface. I have tried the following:
drv = dbDriver("PostgreSQL")
con <- dbConnect(drv,
dbname =…
Question: How can RPostgreSQL be used to query a database table based on a variable containing a vector of primary keys?
Example: In this I have the following code which works for one instance, but does not work when I try to vectorize…
Here is my code, where I am trying to write a data from R to SQLite database file.
library(DBI)
library(RSQLite)
library(dplyr)
library(data.table)
con <- dbConnect(RSQLite::SQLite(), "data.sqlite")
### Read the file you want to load to the…
I have an R shiny server which also hosts a PostgreSQL Database. However, I have trouble connecting R with Postgres.
Here is my R script:
library("dplyr")
library("RPostgreSQL")
con <- dbConnect(PostgreSQL(), dbname = "___", host="localhost",…
I'm trying to connect to a PostgreSQL database from R using SSL with the RPostgreSQL package (On windows).
dbConnect(dbDriver("PostgreSQL"),
user = user,
password = password,
host = host,
dbname =…
I'm having an issue with datetime handling in RPostgreSQL. Specifically it relates to POSIXct objects with a UTC timezone being automatically adjusted to daylight saving during upload to a postgres database. A simple…
I am located in the Eastern Standard Timezone
> Sys.time()
[1] "2017-12-04 11:08:12 EST"
Using RPostgreSQL, I am trying to create a series of 10-minute intervals on a given date.
intervals <- dbGetQuery(con, " select i from…
I am having an issue getting NaN numeric data with dplyr (0.5.0) from a PostgreSQL column of type numeric (and thus supports NaN). The underlying fault is in RPostgreSQL, which reads NaN values as zero. E.g.:
# create table
create table…
I'm running something like this: (sorry it is not 100% reproducible, unless you have postgres running in your machine, with mydb and tables created, and the given user and password)
library(RPostgreSQL)
library(tidyverse)
library(dbplyr)
pg_conn <-…
I'm dealing with some sensitive data, so I'm concerned about using RPostgreSQL. I have all the data necessary loaded into dataframes in R. I'm trying to run queries on the data using the sqldf() function in R. These queries were written for Oracle…
I've a data.frame in R - matches with some 1000+ rows
names(matches)
[1] "name" "c_id" "fname" "lname" "address" "zip_code" "Weight"
nrow(matches)
[1] 1253
I have a postgresql database table - list_m with following columns
db_name, db_cid,…
The Issue
I am attempting to copy the contents of an R dataframe df to a PostgreSQL table table_name located in schema schema_name. By default, PostgreSQL will write tables to the public schema and I do not want to change this setting. The two…