dbndistinct: Count the number of distinct rows in a database table for a...

Description Usage Arguments Value Examples

View source: R/prorepparcodes.R

Description

Count the number of distinct rows in a database table for a given variable

Usage

1
dbndistinct(RMariaDBcon, tablename, variable)

Arguments

RMariaDBcon

database connection object created by RMySQL dbConnect

tablename

character name of a database table

variable

character name of a variable in that database table

Value

numeric value

Examples

1
2
3
4
5
6
con <- RMariaDB::dbConnect(RMariaDB::MariaDB(), dbname = "test")
on.exit(RMariaDB::dbDisconnect(con))
# Transfer the iris data frame to the database
RMariaDB::dbWriteTable(con, "iris_in_db", iris, row.names = FALSE, overwrite = TRUE)
# Count the number of species
dbndistinct(con, "iris_in_db", Species)

stix-global/eutradeflows documentation built on Nov. 13, 2020, 9:23 p.m.