DataSHIELD implementation of tibble::as_tibble. Currently only implemented for data frames and tibbles.

ds.as_tibble(
  x = NULL,
  .rows = NULL,
  .name_repair = "check_unique",
  rownames = NULL,
  newobj = NULL,
  datasources = NULL
)

Arguments

x

A data frame or matrix.

.rows

The number of rows, useful to create a 0-column tibble or just as an additional check.

.name_repair

Treatment of problematic column names:

  • "minimal": No name repair or checks, beyond basic existence.

  • "unique": Make sure names are unique and not empty.

  • "check_unique": (default value), no name repair, but check they are unique.

  • "universal": Make the names unique and syntactic.

rownames

How to treat existing row names of a data frame or matrix:

  • `NULL`: remove row names. This is the default.

  • `NA`: keep row names.

  • A string: the name of a new column. Existing rownames are transferred into this column and the row.names attribute is deleted. No name repair is applied to the new column name, even if `x` already contains a column of that name.

newobj

Character specifying name for new server-side data frame.

datasources

DataSHIELD connections object.

Value

No return value, called for its side effects. A tibble with the name specified by newobj is created on the server.

Examples

if (FALSE) {
ds.as_tibble(
  x = "mtcars",
  newobj = "mtcars_tib",
  datasources = conns
)
}