similar to: Compress string memCompress/Decompress

Displaying 20 results from an estimated 2000 matches similar to: "Compress string memCompress/Decompress"

2010 Jan 14
1
memDecompress and zlib compressed base64 encoded string
Hi, I have zlib compressed strings (example is attached) and would like to decompress them using memDecompress ... I try this: > connection <- file("compressed.txt","r") > compressed <- readLines(connection) > memDecompress(as.raw(compressed),type="g") Error in memDecompress(as.raw(compressed), type = "g") : internal error -3 in
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 <-
2024 Jul 04
1
libdeflate
Since the 4.4.0 release, R can make use of libdeflate. From the release notes: > memCompress() and memDecompress() will use the libdeflate library (https://github.com/ebiggers/libdeflate) if installed. This uses the same type of compression for type = "gzip" but is 1.5-2x faster than the system libz library on some common platforms: the speed-up may depend on the library
2011 Mar 14
1
Tinycore & error in memCompress() in make check
Hi, I get the same error as mentioned in http://r.789695.n4.nabble.com/error-in-memCompress-in-make-check-td3318922.html I try to compile R 2.12.2 under Tinycore 3.5.1 running in VirtualBox 4.0.4. Since first xz was not installed I must have used the internal version which comes with the R source tar ball. But after installing the xz 5.0.0 extension the error remained. Any idea what else I
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.
2008 Sep 25
1
Saving R-objects to a database
Someone solved the problem of saving R-objects to a database? These are the two varaints I've tried so far without success: 1) ser = rawToChar(serialize(obj, NULL, ascii=TRUE)) dbSendQuery(link, paste("insert into table values(1, '",ser,"')",sep='')) The field to save the object in the MySQL Database is of type text. unser = dbGetQuery(link,"select
2009 Dec 18
1
The RSQLite version of dbGetQuery drops colums
Hi all, I just noticed (the hard way of course) that when a query returns 0 rows, the columns in the resulting data.frame get dropped as well. See the following example code (where conn is an active connection to an SQLite db): > dbGetQuery(conn, "select 1 as hey, 2 as ho where 1") hey ho 1 1 2 > dbGetQuery(conn, "select 1 as hey, 2 as ho where 0") data frame
2011 Feb 28
1
Data type problem when extract data from SQLite to R by using RSQLite
Hi there, When I extract data from SQLite to R, the data types (or modes) of the extracted data seems to be determined by the value of the first row. Please see the following example. When I put the missing values first, the column extracted is of the mode character. > str(dbGetQuery(sql.industry, + "select pya_var from annual_data3 + order by
2005 Apr 15
1
How can I change SQLite cache size for R session?
How can I change SQLite cache size for R session? SQLite cache size can be set by a pragma, for the duration of the session - or by default. .pragma cache_size .pragma default_cache_size my questions are about RSQLite, version 0.4, running on Windows: - what is the cache size set to when SQLite is invoked from R? - if the page_size is set to 4096 what will be the cache size in bytes
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: >
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")
2009 Mar 30
1
Importing csv file with character values into sqlite3 and subsequent problem in R / RSQLite
Dear all, I'm trying to import a csv file into sqlite3 and from there into R. Everything looks fine exepct that R outputs the character values in an odd fashion: they are shown as "\"CHARACTER\"" instead of "CHARACTER", but only if I show the character variable as a vector. Does someone know why this happens? Below is a sample code. The first part is written in
2012 May 02
1
Decompressing raw vectors in memory
Hi all, I'm struggling to decompress a gzip'd raw vector in memory: content <- readBin("http://httpbin.org/gzip", "raw", 1000) memDecompress(content, type = "gzip") # Error in memDecompress(content, type = "gzip") : # internal error -3 in memDecompress(2) I'm reasonably certain that the file is correctly compressed, because if I save it
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:") >
2010 Dec 10
1
help with RSQLite adding a new column
I'm new to using sql so I'm having difficulties (and worries) in adding a new column of data to a table I have. Its a very large file (around 5 Gb) which is why I'm having to use SQL I have a table with variables ID, IDrec and IDdes and the variables IDrec and IDdes give a mapping of some other values but the other values are associated with the ID variable (think of IDrec and IDdes
2020 Oct 03
1
Lahman Baseball Data Using R DBI Package
The double quotes are required by SQL if a name is not of the form letter-followed-by-any-number-of-letters-or-numbers or if the name is a SQL keyword like 'where' or 'select'. If you are doing this from a function, you may as well quote all the names. -Bill On Fri, Oct 2, 2020 at 6:18 PM Philip <herd_dog at cox.net> wrote: > The \?2B\? worked. Have no idea why. Can
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
2008 Sep 11
2
database table merging tips with R
I have not devoted time to setting up ROracle since binaries are not available and it seems to require some effort to compile (see http://cran.r-project.org/web/packages/ROracle/index.html). On the other hand, RODBC worked more or less magically once I set up the data sources. What is your success using ROracle and why would it be preferable to RODBC ? -Avram On Thursday, September 11,
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,