Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export(tiledb_config_unset)
export(tiledb_ctx)
export(tiledb_ctx_set_tag)
export(tiledb_ctx_stats)
export(tiledb_datatype_R_type)
export(tiledb_delete_metadata)
export(tiledb_dense)
export(tiledb_dim)
Expand Down
11 changes: 11 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ tiledb_datatype_string_to_sizeof <- function(str) {
.Call(`_tiledb_tiledb_datatype_string_to_sizeof`, str)
}

#' Map from TileDB type to R datatype
#'
#' This function maps from the TileDB types to the (fewer) key datatypes in R. This
#' can be lossy as TileDB integers range from (signed and unsigned) 8 to 64 bit whereas
#' R only has (signed) 32 bit values. Similarly, R only has 64 bit doubles whereas TileDB
#' has 32 and 64 bit floating point types. TileDB also has more character encodings, and the
#' full range of (NumPy) date and time types.
#'
#' @param datatype A string describing one TileDB datatype
#' @return A string describing the closest match for an R datatype
#' @export
tiledb_datatype_R_type <- function(datatype) {
.Call(`_tiledb_tiledb_datatype_R_type`, datatype)
}
Expand Down
21 changes: 21 additions & 0 deletions man/tiledb_datatype_R_type.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/libtiledb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ int32_t tiledb_datatype_string_to_sizeof(const std::string str) {
return static_cast<int32_t>(tiledb_datatype_size(_string_to_tiledb_datatype(str)));
}

//' Map from TileDB type to R datatype
//'
//' This function maps from the TileDB types to the (fewer) key datatypes in R. This
//' can be lossy as TileDB integers range from (signed and unsigned) 8 to 64 bit whereas
//' R only has (signed) 32 bit values. Similarly, R only has 64 bit doubles whereas TileDB
//' has 32 and 64 bit floating point types. TileDB also has more character encodings, and the
//' full range of (NumPy) date and time types.
//'
//' @param datatype A string describing one TileDB datatype
//' @return A string describing the closest match for an R datatype
//' @export
// [[Rcpp::export]]
std::string tiledb_datatype_R_type(std::string datatype) {
tiledb_datatype_t dtype = _string_to_tiledb_datatype(datatype);
Expand Down