Skip to content

Commit

Permalink
Convert four uses of as.data.frame to return_as="data.frame"
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 11, 2023
1 parent 02b829c commit 07c0fb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/DataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
##' ## turn factor into character
##' irisdf <- within(iris, Species <- as.character(Species))
##' fromDataFrame(irisdf, uri)
##' arr <- tiledb_array(uri, as.data.frame=TRUE, sparse=FALSE)
##' arr <- tiledb_array(uri, return_as="data.frame", sparse=FALSE)
##' newdf <- arr[]
##' all.equal(iris, newdf)
##' }
Expand Down Expand Up @@ -265,7 +265,7 @@ fromDataFrame <- function(obj, uri, col_index=NULL, sparse=TRUE, allows_dups=spa
if (dir.exists(uri)) unlink(uri, recursive=TRUE)
fromDataFrame(obj, uri)

df <- tiledb_array(uri, as.data.frame=TRUE)
df <- tiledb_array(uri, return_as="data.frame")
df[]
}

Expand All @@ -292,7 +292,7 @@ fromDataFrame <- function(obj, uri, col_index=NULL, sparse=TRUE, allows_dups=spa
}
fromDataFrame(bkdf, uri)

arr <- tiledb_array(uri, as.data.frame = TRUE)
arr <- tiledb_array(uri, return_as="data.frame")
newdf <- arr[]
invisible(newdf)
}
Expand All @@ -305,7 +305,7 @@ fromDataFrame <- function(obj, uri, col_index=NULL, sparse=TRUE, allows_dups=spa
fromDataFrame(df, uri)
cat("Data written\n")

arr <- tiledb_array(uri, as.data.frame = TRUE)
arr <- tiledb_array(uri, return_as="data.frame")
newdf <- arr[]
invisible(newdf)
}
2 changes: 1 addition & 1 deletion R/SparseMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fromSparseMatrix <- function(obj,
toSparseMatrix <- function(uri) {
stopifnot(`Argument 'uri' must be character` = is.character(uri))

arr <- tiledb_array(uri, as.data.frame=TRUE, query_layout="UNORDERED")
arr <- tiledb_array(uri, return_as="data.frame", query_layout="UNORDERED")
obj <- arr[]

dimnm <- list(NULL, NULL) # by default no dimnames
Expand Down

0 comments on commit 07c0fb3

Please sign in to comment.