Skip to content

Instantly share code, notes, and snippets.

@javieroot
Created August 12, 2018 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javieroot/b20ca0ce5f5fc673191e54184de72ffc to your computer and use it in GitHub Desktop.
Save javieroot/b20ca0ce5f5fc673191e54184de72ffc to your computer and use it in GitHub Desktop.
Conexión a base de datos de PostgreSQL desde R
# Una vez teniendo lista la instalación de PostgreSQL y R:
# En el terminal:
pacman -S postgresql-libs
# Dentro de R instalar el paquete RPostgreSQL
install.packages("RPostgreSQL")
# Una vez realizado lo anterior se procede a realizar la conexión con:
library(RPostgreSQL)
con <- dbConnect(PostgreSQL(), dbname = "dsl",
host = "localhost/ip_servidor", port = 5432,
user = "usuario", password = "password")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment