Skip to contents

add_sample_plan registers new sampling events and generates new sample ids

Usage

add_sample_plan(
  con,
  sample_plan,
  verbose = FALSE,
  sample_status_code = "created"
)

Arguments

con

A DBI connection object

sample_plan

A table containing the following columns from a sample plan: location_code, sample_event_number, first_sample_date, sample_bin_code, min_fork_length, max_fork_length, and expected_number_of_samples.

Value

a named value number_of_samples_added reflecting the number of samples added to the database.

Examples

# example database connection
con <- gr_db_connect()
#>  refreshing Azure auth token
#>  refreshing Azure auth token ... done
#> 
#> Error: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061)
#> 	Is the server running on that host and accepting TCP/IP connections?
#> connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
#> 	Is the server running on that host and accepting TCP/IP connections?
add_sample_plan(con, sample_plan)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'dbObj' in selecting a method for function 'dbIsValid': object 'con' not found