similar to: RSQLite to input dataframe

Displaying 20 results from an estimated 3000 matches similar to: "RSQLite to input dataframe"

2012 Mar 27
1
RSqlite UPDATE command problem
All: I am using RSqlite and want to be able to update individual values in a record, such as with this simple example: library(RSQLite) drv<-dbDriver("SQLite") con<-dbConnect(drv,"test.db") my.data<-data.frame(countries=c("US","UK","Canada","Australia","NewZealand"),vals=c(52,36,74,10,98))
2004 Nov 25
3
Searching for a string in RSQLite
I'd like to search for a particular string in an SQLite database using RSQLite, but I'm running into problems constructing the query properly, because of embedded quotes and parens in the string. Is there a function that escapes these for me, or some other fixup that would let me do the queries below? In the real situation I don't have control over what strings get searched for.
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
2005 Oct 27
2
RSQLite problems
Hi, I'm experimenting with using (R)SQLite to do data management. Here are two little problems that I've encountered: 1. The presence of ',' in string values causes trouble since ',' is also the delimiter used in the SQL statement. 2. A newline '\n' line attached to the last string value of each row. Some examples: > library (RSQLite) Loading required
2008 Sep 15
2
S4 coercion responsibility
Should functions or the user be responsible for coercing an S4 object argument containing the proper object (and thus should below be considered a bug in the packages or not)? The example is with RSQLite but the same thing happens with RMySQL, and other DBI packages. > library("RSQLite") Loading required package: DBI > m <- dbDriver("SQLite") > con <-
2011 Jan 14
3
RSQLite - How to express(or save) a dataframe as an output?
Dear R helpers Suppose following is an output due to some R process. I wish to save it as a table in 'temp.db' df <- data.frame(x = c(5, 4, 3, 11), y = c(25, 16, 9, 121))     library(RSQLite)     write('** Initializing','')     drv <- dbDriver("SQLite", shared.cache = TRUE)     con <- dbConnect(drv, dbname = "temp.db",
2008 May 12
1
Insert a recorde into a table using SQL
Dear list, I want to insert a recorde into a SQLite table by dbGetQuery(), but there is a problem when the value contains quotation mark. > dd<-data.frame(txt=c("having both ' and \" in character.","OK")) > library(RSQLite) Loading required package: DBI > con<-dbConnect(dbDriver("SQLite"),":memory:") >
2002 Oct 16
5
Database newbee problem...
Hi all, This is a potentially very stupid question about MySQL <-> R interaction, but I have not been able to solve it. I'm just trying to connect R to my MySQL databse, and gets this: > library(RMySQL) Loading required package: methods > m <- dbDriver("MySQL") > con <- dbConnect(m,group="testdb") Process R segmentation fault at Wed Oct 16 07:04:30
2010 Oct 13
2
Rmysql - dbWritetable
Dear Rusers, I am trying to feed my database with data from a file. But since my file (2010101000.txt) there`s no headers I am facing problem because the result data.frame is not separated my columns. How could I set variables names for each columns in *dbWriteTable*? I have tried the command below but I don`t know how to fill the *field.type*option. dbWriteTable(con, "b20101010",
2009 Nov 30
1
RSQLite does not read very large values correctly
Hello, I am trying to import data from an SQLite database to R. Unfortunately, I seem to get wrong data when I try to import very large numbers. For example: I look at the database via SQLiteStudio(v.1.1.3) and I see the following values: OrderID Day TimeToclose 1 2009-11-25 29467907000 2 2009-11-25 29467907000 3 2009-11-25 29467907000 Now I run this R Code: >
2012 Jun 12
1
Not able to write to PostgreSQL database using "dbWriteTable"
Dear R User's Please help me to debug this issue. I am trying to write some data ( i= 6) to PostgreSQL database, but it not writing. Is there any issue in the way I use "dbWriteTable"? ++++++++++++++++++ Source Code ++++++++++++++++++++++++ library("DBI") library("RPostgreSQL") drv1 <- dbDriver("PostgreSQL") i=6 connAE1 <- dbConnect(drv1,host
2010 Aug 12
2
How to building my own datafile
Hi folks, I'm prepared building my own datafiles, simple file at start, for testing wondering how to process? Which software will be used, MySQL/MS-SQL/MS-Excel/Open Office-Calc etc? On searching I found r-cran-rmysql on Ubuntu repo. Further searching I found; RMySQL: R interface to the MySQL database http://cran.r-project.org/web/packages/RMySQL/index.html Whether install the above
2010 Nov 15
5
How to Read a Large CSV into a Database with R
Hi, I'm working in R 2.11.1 x64 on Windows x86_64-pc-mingw32. I'm trying to insert a very large CSV file into a SQLite database. I'm pretty new to working with databases in R, so I apologize if I'm overlooking something obvious here. I'm trying to work with the American Community Survey data, which is two 1.3GB csv files. I have enough RAM to read one of them into memory,
2011 Aug 31
2
dbWriteTable error message
I am at loss of what is going on here ... I am trying to write to a SQLite database: con <- dbConnect(dbDriver("SQLite"), dbname="pres-docs.rqda") I have a data frame that is 889 rows by 7 columns. The column number and types agree with the database table columns and column type. dbWriteTable(con, "fileAttr", DF.4, row.names=FALSE, overwrite=TRUE) Then I get
2010 Jul 09
2
Compress string memCompress/Decompress
Hello, I would like to compress a long string (character vector), store the compressed string in the text field of a SQLite database (using RSQLite), and then load the text back into memory and decompress it back into the the original string. My character vector can be compressed considerably using standard gzip/bzip2 compression. In theory it should be much faster for me to compress/decompress
2010 May 07
2
Package RPostgreSQL : Problem with dbWriteTable
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100507/f5128631/attachment.pl>
2005 Dec 31
2
Q about RSQLite
Happy new year, dear listers, I have a question about Rsqlite. when I fetch the data out of sqlite database, there is something like '\r\n' at the end of last column. Here is the example: Sepal_Length Sepal_Width Petal_Length Petal_Width Species 1 5.1 3.5 1.4 0.2 setosa\r\n 2 4.9 3.0 1.4 0.2 setosa\r\n 3
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users, I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database. This is what I tried to do: library(RSQLite) con <- dbDriver("SQLite") db <- dbConnect(con, "test") dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)') data.bin <-
2011 Dec 02
2
help in dbWriteTable
hi I need some help in dbWriteTable. I'm not able to insert the rows in the table if the column order are not same in the database and in the dataframe which i'm inserting. Also facing issue if the table is already created externally and inserting it thru dbWrite. is there some way that we can sepecify the rownames in the dbwrite..or any method which will solve my problem -- View