/usr/share/doc/r-cran-rsqlite/tests/gc-tests.R is in r-cran-rsqlite 0.11.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | library("RSQLite")
torture=FALSE
drv <- SQLite()
con <- dbConnect(drv, tempfile())
table.name <- "testing"
set.seed(123)
df <- as.data.frame( matrix( rnorm( 225000 ), ncol = 225 ) )
dbWriteTable( con, "testing", df, row.names = FALSE,
overwrite = TRUE )
get_data <- function( indices, con, table_name ) {
query <- paste(
"select * from",
table_name,
"where _ROWID_ in (",
paste( indices, collapse = "," ),
")"
)
dbGetQuery( con, query )
}
gctorture(on=torture)
ans <- get_data(1:3, con, table.name )[ ,1:5]
ans
gctorture(on=FALSE)
df2 <- data.frame(name=letters[1:10],
id=1:10,
score=1:10 * 2.345)
gctorture(on=torture)
dbWriteTable(con, "t2", df2)
gctorture(on=FALSE)
|