Skip to content

Commit

Permalink
Provide additional aliases for S4 subsetting methods (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored May 11, 2020
1 parent 2a428ef commit 972981f
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 5 deletions.
9 changes: 8 additions & 1 deletion R/Config.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ tiledb_config <- function(config = NA_character_) {
#' cfg <- tiledb_config()
#' cfg["sm.tile_cache_size"]
#' cfg["does_not_exist"]
#'
#' @aliases [,tiledb_config
#' @aliases [,tiledb_config-method
#' @aliases [,tiledb_config,ANY,tiledb_config-method
#' @aliases [,tiledb_config,ANY,ANY,tiledb_config-method
setMethod("[", "tiledb_config",
function(x, i, j, ..., drop=FALSE) {
if (!is.character(i)) {
Expand Down Expand Up @@ -79,6 +82,10 @@ setMethod("[", "tiledb_config",
#' cfg["sm.tile_cache_size"] <- 100
#' cfg["sm.tile_cache_size"]
#'
#' @aliases [<-,tiledb_config
#' @aliases [<-,tiledb_config-method
#' @aliases [<-,tiledb_config,ANY,tiledb_config-method
#' @aliases [<-,tiledb_config,ANY,ANY,tiledb_config-method
setMethod("[<-", "tiledb_config",
function(x, i, j, value) {
if (!is.character(i)) {
Expand Down
8 changes: 8 additions & 0 deletions R/DenseArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ attribute_buffers <- function(array, sch, dom, sub, selected) {
#' @param ... Extra parameter for method signature, currently unused.
#' @param drop Optional logical switch to drop dimensions, default FALSE, currently unused.
#' @return An element from a dense array
#' @aliases [,tiledb_dense
#' @aliases [,tiledb_dense-method
#' @aliases [,tiledb_dense,ANY,tiledb_dense-method
#' @aliases [,tiledb_dense,ANY,ANY,tiledb_dense-method
setMethod("[", "tiledb_dense",
function(x, i, j, ..., drop = FALSE) {
## helper function to deal with i and/or j missing
Expand Down Expand Up @@ -356,6 +360,10 @@ setMethod("[", "tiledb_dense",
#' @param value The value being assigned
#' @return The modified object
#' @importFrom utils head
#' @aliases [<-,tiledb_dense
#' @aliases [<-,tiledb_dense-method
#' @aliases [<-,tiledb_dense,ANY,tiledb_dense-method
#' @aliases [<-,tiledb_dense,ANY,ANY,tiledb_dense-method
setMethod("[<-", "tiledb_dense",
function(x, i, j, ..., value) {
if (!is.list(value)) {
Expand Down
4 changes: 4 additions & 0 deletions R/FilterList.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ setMethod("nfilters", signature(object = "tiledb_filter_list"),
#' filter_list[0]
#'
#' @export
#' @aliases [,tiledb_filter_list
#' @aliases [,tiledb_filter_list-method
#' @aliases [,tiledb_filter_list,ANY,tiledb_filter_list-method
#' @aliases [,tiledb_filter_list,ANY,ANY,tiledb_filter_list-method
setMethod("[", "tiledb_filter_list",
function(x, i, j, ..., drop = FALSE) {
tiledb_filter.from_ptr(libtiledb_filter_list_get_filter_from_index(x@ptr, i))
Expand Down
8 changes: 8 additions & 0 deletions R/SparseArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ as_data_frame <- function(dom, data, extended=FALSE) {
#' @param ... Extra parameter for method signature, currently unused.
#' @param drop Optional logical switch to drop dimensions, default FALSE, currently unused.
#' @return An element from the sparse array
#' @aliases [,tiledb_sparse
#' @aliases [,tiledb_sparse-method
#' @aliases [,tiledb_sparse,ANY,tiledb_sparse-method
#' @aliases [,tiledb_sparse,ANY,ANY,tiledb_sparse-method
setMethod("[", "tiledb_sparse",
function(x, i, j, ..., drop = FALSE) {
## helper function to deal with i and/or j missing
Expand Down Expand Up @@ -265,6 +269,10 @@ setMethod("[", "tiledb_sparse",
#' @param ... Extra parameter for method signature, currently unused.
#' @param value The value being assigned
#' @return The modified object
#' @aliases [<-,tiledb_sparse
#' @aliases [<-,tiledb_sparse-method
#' @aliases [<-,tiledb_sparse,ANY,tiledb_sparse-method
#' @aliases [<-,tiledb_sparse,ANY,ANY,tiledb_sparse-method
setMethod("[<-", "tiledb_sparse",
function(x, i, j, ..., value) {
if (!is.list(value)) {
Expand Down
8 changes: 8 additions & 0 deletions R/tiledb_array.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ setMethod("show",
#' @param drop Optional logical switch to drop dimensions, default FALSE, currently unused.
#' @return An element from the sparse array
#' @import nanotime
#' @aliases [,tiledb_array
#' @aliases [,tiledb_array-method
#' @aliases [,tiledb_array,ANY,tiledb_array-method
#' @aliases [,tiledb_array,ANY,ANY,tiledb_array-method
setMethod("[", "tiledb_array",
function(x, i, j, ..., drop = FALSE) {
## add defaults
Expand Down Expand Up @@ -279,6 +283,10 @@ setMethod("[", "tiledb_array",
#' arr[c(1,2), c(1,3)] <- c(42,43) ## two values
#' arr[2, 4] <- 88 ## or just one
#' }
#' @aliases [<-,tiledb_array
#' @aliases [<-,tiledb_array-method
#' @aliases [<-,tiledb_array,ANY,tiledb_array-method
#' @aliases [<-,tiledb_array,ANY,ANY,tiledb_array-method
setMethod("[<-", "tiledb_array",
function(x, i, j, ..., value) {
if (!is.data.frame(value)) {
Expand Down
11 changes: 8 additions & 3 deletions inst/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Ongoing

* This release of the R package supports [TileDB 1.7.7](https://github.com/TileDB-Inc/TileDB/releases/tag/1.7.7) and [TileDB 2.0.0](https://github.com/TileDB-Inc/TileDB/releases/tag/2.0.0)

## Improvements

- All S4 classes are now consistently documented or aliased

# 0.6.0

* This release of the R package supports [TileDB
1.7.7](https://github.com/TileDB-Inc/TileDB/releases/tag/1.7.7) and
[TileDB 2.0.0](https://github.com/TileDB-Inc/TileDB/releases/tag/2.0.0)
* This release of the R package supports [TileDB 1.7.7](https://github.com/TileDB-Inc/TileDB/releases/tag/1.7.7) and [TileDB 2.0.0](https://github.com/TileDB-Inc/TileDB/releases/tag/2.0.0)

## Improvements

Expand Down
4 changes: 4 additions & 0 deletions man/sub-tiledb_array-ANY-method.Rd

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

5 changes: 4 additions & 1 deletion man/sub-tiledb_config-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/sub-tiledb_dense-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/sub-tiledb_filter_list-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/sub-tiledb_sparse-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/subset-tiledb_array-ANY-ANY-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/subset-tiledb_config-ANY-ANY-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/subset-tiledb_dense-ANY-ANY-ANY-method.Rd

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

4 changes: 4 additions & 0 deletions man/subset-tiledb_sparse-ANY-ANY-ANY-method.Rd

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

0 comments on commit 972981f

Please sign in to comment.