Search notes:

R package: RSQLite

RSQLite is the SQLite dependent DBI backend.

Simple example

library(RSQLite)


sqlLite <- dbConnect(RSQLite::SQLite(), ':memory:');

df <- data.frame(
   col_one   = c( 1   ,  2   ,  3     ),
   col_two   = c('one', 'two', 'three'),
   col_three = c('foo', 'bar', 'baz'  )
);

dbWriteTable(sqlLite, 'tab', df);

res <- dbGetQuery(sqlLite,
' select
     col_one * 5     as one_5,
     upper(col_two)  as two_U
  from
     tab
  where
     col_one != 2
  order by
     col_three');

print(res);
#
#  one_5 two_U
#      15 THREE
#       5   ONE

dbDisconnect(sqlLite);
Github repository about-R, path: /packages/RSQLite/simple.R

See also

R packages
Import data into R for processing

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745509029, '18.117.8.11', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/packages/RSQLite/index(76): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78