Description Usage Arguments Value Examples
View source: R/prorepparcodes.R
Count the number of distinct rows in a database table for a given variable
1 | dbndistinct(RMariaDBcon, tablename, variable)
|
RMariaDBcon |
database connection object created by RMySQL |
tablename |
character name of a database table |
variable |
character name of a variable in that database table |
numeric value
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.