fb_connect: Returns the connection to the database

View source: R/fb_connect.R

fb_connectR Documentation

Returns the connection to the database

Description

Returns the connection to the database

Usage

fb_connect(
  dbname = "flybase",
  host = "chado.flybase.org",
  port = 5432,
  user = "flybase",
  password = "flybase",
  dplyr = FALSE,
  ...
)

Arguments

dbname

(character) database name. default: flybase

host

(character) database name. default: chado.flybase.org

port

(integer) database name. default: 5432

user

(character) database name. default: flybase

password

(character) database name. default: flybase

dplyr

(logical) if TRUE, returns class src_postgres; otherwise, an object of class PostgreSQLConnection. Default: FALSE

...

further args passed on to dbConnect

Details

Make a connection with the read only postgreSQL version of the flybase database. For intense use, one should downlaod the database and change this function.

Examples

## Not run: 
(conn <- fb_connect())

# using with dplyr
library("dplyr")
(src <- fb_connect(dplyr = TRUE))
orgs <- src %>% tbl("organism")
orgs %>% filter(genus == "Antheraea")

tbl(src, sql('SELECT * FROM phenotype WHERE "phenotype_id" = 8511'))

## End(Not run)

ropensci/rflybase documentation built on May 18, 2022, 6:35 p.m.