[<-,tiledb_array,ANY,ANY,ANY-method | R Documentation |
This function assigns a right-hand side object, typically a data.frame or something that can be coerced to a data.frame, to a tiledb array.
## S4 replacement method for signature 'tiledb_array,ANY,ANY,ANY'
x[i, j, ...] <- value
x |
sparse or dense TileDB array object |
i |
parameter row index |
j |
parameter column index |
... |
Extra parameter for method signature, currently unused. |
value |
The value being assigned |
For sparse matrices, row and column indices can either be supplied as part of the left-hand side object, or as part of the data.frame provided approrpiate column names.
This function may still still change; the current implementation should be considered as an initial draft.
The modified object
## Not run:
uri <- "quickstart_sparse" ## as created by the other example
arr <- tiledb_array(uri) ## open array
df <- arr[] ## read current content
## First approach: matching data.frame with appriate row and column
newdf <- data.frame(rows=c(1,2,2), cols=c(1,3,4), a=df$a+100)
## Second approach: supply indices explicitly
arr[c(1,2), c(1,3)] <- c(42,43) ## two values
arr[2, 4] <- 88 ## or just one
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.