remove_cnt | R Documentation |
Generic implementing of how to remove content from different connectors:
ConnectorDBI: Uses DBI::dbRemoveTable()
to remove the table from a DBI connection.
ConnectorFS: Uses fs::file_delete()
to delete the file.
remove_cnt(connector_object, name, ...)
## S3 method for class 'ConnectorDBI'
remove_cnt(connector_object, name, ...)
## S3 method for class 'ConnectorFS'
remove_cnt(connector_object, name, ...)
connector_object |
Connector The connector object to use. |
name |
character Name of the content to read, write, or remove. Typically the table name. |
... |
Additional arguments passed to the method for the individual connector. |
invisible connector_object.
# Remove table in a DBI database
cnt <- connector_dbi(RSQLite::SQLite())
cnt |>
write_cnt(iris, "iris") |>
list_content_cnt()
cnt |>
remove_cnt("iris") |>
list_content_cnt()
# Remove a file from the file storage
folder <- withr::local_tempdir()
cnt <- connector_fs(folder)
cnt |>
write_cnt("this is an example", "example.txt")
cnt |>
list_content_cnt(pattern = "example.txt")
cnt |>
read_cnt("example.txt")
cnt |>
remove_cnt("example.txt")
cnt |>
list_content_cnt(pattern = "example.txt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.