similar to: RMySQL question, sql with R vector or list

Displaying 20 results from an estimated 5000 matches similar to: "RMySQL question, sql with R vector or list"

2011 Oct 19
4
Using SQL "IN" with RJDBC or RMySQL
Hello, The code below works fine up until I try to use the "IN" statement in the last line. The proper SQL format is: SELECT * FROM this_table WHERE this_column IN (1,2,3,4,5) But, I think I may be getting something like: SELECT * FROM this_table WHERE this_column IN c(1,2,3,4,5) Which makes no sense in SQL. I think it may be just a matter of string massaging, but I'm not
2005 May 02
2
RMySQL query: why result takes so much memory in R ?
Hi I just started with RMySQL. I have a database with roughly 12 millions rows/records and 8 columns/fields. From all 12 millions of records I want to import 3 fields only. The fields are specified as:id int(11), group char(15), measurement float(4,2). Why does this take > 1G RAM? I run R on suse linux, with 1G RAM and with the code below it even fills the whole 1G of swap. I just
2011 Mar 23
1
using R variables in RMySQL query
I have the following function myGetstockdataMySQL <- function(startdate, enddate, ticker) { con <- dbConnect(MySQL(), user="blahblah", password="blahblah", dbname="blahblah", host="localhost") rs <- dbGetQuery(con, "SELECT price.close FROM price INNER JOIN stocks ON stocks.stock_id=price.stock_ID WHERE (price.date_holding BETWEEN
2011 Feb 09
2
Insert variable in RMySQL-Statement
Dear list, I'm working with a MySQL-Table and would like to extract selected ids that are stored in a vector: Ids <- c(1,2,3) How do I insert this variable in a for loop like this: For (a in values) { Temp <- dbGetQuery(con, "select * from db Where id = <ID>";) } My problem is to split the select-statement and insert the current id. How can I handle this problem?
2005 Mar 09
1
RMySQL installed but not availalable
I don't use MySQL but I have seen messages like this before. They often have replies which indicate that you need to follow the instructions more closely. I suggest you search the list for these previous posts as I'm sure there is help there, somewhere! Tom > -----Original Message----- > From: Adriano von Sydow [mailto:pdasilva at xtra.co.nz] > Sent: Thursday, 10 March 2005 5:13
2007 Mar 20
1
RMySQL load error
I'm having trouble getting RMySQL to load. I was able to build it and install it (RMySQL_0.5-11.tar.gz). I was also able to build and install mysql-5.0.37. I've read many postings about this but have not found a mention of my particular problem (some closely related). I get the "unable to load shared library, no such file" error, but all the files do exist, RMySQL.so and
2007 Jun 06
1
Question: RMySQL bulk load/update one column, dbWriteTable()?
Hi, I have a question reading using RMySQL trying to load one R vector into a table column. To be more specifically, the table is there populated. Now I add a new column and want to populate this. Can some colleagues on this list teach me how to do this? I know how to write one R object/table into MYSQL table using dbWriteTable. But in this situation, I just want to do one column. Thanks
2010 Jun 23
1
RJDBC vs RMySQL vs ???
I am running a simple SQL SELECT statement that involvs 50k + data points using R and the RJDBC interface. I am facing very slow response times in both the RGUI and the R console. When running this SQL statement directly in a SQL client I have processing times that are a lot lot faster (which means that the SQL statement itself is not the problem). Did any of you compare RJDBC vs RMySQL or is
2007 May 31
1
RMySQL DBI question
Dear colleague, I have two data frame which I tried to use dbWriteTable function with append=TRUE to write to the mysql database. The problem is that if I am run my R script directly then it is fine. Both data frame got written into the database. But when I tried to embed the script to be called as system("R --save < whatever.R") in my perl script, I saw very strange things. One
2002 Sep 12
1
DBI / MySQL problems
Hi. I frequently use RMySQL package to interface R with MySQL databases. I was having a try with package DBI and I got the following error: > library(RMySQL) > library(DBI) > drv <- dbDriver("MySQL") > ch <- dbConnect(drv, dbname="mydb", user="myuser", password="mypasswd") > ibm <- dbGetQuery(ch,"select * from table where
2004 Sep 22
3
RMySQL and Blob
Dear R experts, Does RMySQL package handle Blob datatype in a MySQL database? Blob can represent an image, a sound or some other large and complex binary objects. In an article published by R-database special interest group, named "A common database interface (DBI)" (updated June 2003), it's mentioned in "open issues and limitations" that "We need to carefully plan
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",
2007 Sep 27
1
RMySQL NA/NULL value storage error
Greetings all, I am running R 2.5.1, RMySQL 0.6 , and DBI 0.2-3 on Windows XP Like others, I am having trouble with NA/Null value conversions between R and a MySQL database via DBI, but I could not find my exact problem in the archives. Most of the time NA values in R get transferred correctly to the database and back again, unless (apparently) if they are in the last column of the table being
2005 Nov 17
1
Histogram over a Large Data Set (DB): How?
Hi! I'm new to R, and I have a question about how R works with large data sets --- in particular, data sets that come from databases. I'm using R 2.2.0 with the DBI package (0.1-9) and the RMySQL package (0.5-5). My get-my-feet-wet-with-R project is to make a histogram from a data set stored in a MySQL database. In particular, I have a table that describes some observed spam emails.
2008 Apr 11
1
SQL INSERT using RMySQL
Hi All, I've finally gotten around to database access using R. I'm happily extracting rows from a MySQL database using RMySQL, but am having problems appending rows to an existing table. What I *want* to do is to append rows to the table, allowing the database to automatically generate primary key values. I've only managed to add rows by using dbWriteTable( con,
2006 Oct 16
3
Install RMySQL with R 2.4.0
I just installed RMySQL 0.5-9 with R 2.4.0 on Windows XP and got the following error message when trying to run a script with RMySQL: Error in library(RMySQL) : 'RMySQL' is not a valid package -- installed < 2.0.0? Any ideas? Thanks, Frank
2006 Nov 07
3
have I an actual matrix?
Hi all! I do hope question from newcomers are wellcome here! Thanks in advance. Trying to catch up and to acquired the needed background to easily read R documents it is being a bit hard to me to get into the required concepts to deal with data. I am trying to get data from a MySQL database and plotting it with barplot. Here the code... library(RMySQL) con <- dbConnect(dbDriver
2009 Dec 30
1
seg-fault... but on what
I got the following after running succesfully through this loop 28 million times... the loop opens text files in a directory and inserts line by line into a database... *** caught segfault *** address 0xc0000010, cause 'memory not mapped' Traceback: 1: .getGeneric(f, where, package) 2: getGeneric("coerce", where = where) 3: as(obj, "integer") 4:
2007 Dec 14
2
connecting RMySQL to and external server
Dear list, I learned how to connect R to a local MySQL server, using: drv <- dbDriver("MySQL") con <- dbConnect(drv, user="root", password="mypass", dbname="mydb") Is it possible to connect R in this way to an external server (on a different machine, with a different IP)? I read the documentation on ?dbConnect (and everything I could find on the
2003 Feb 07
3
RMySQL
Being relatively new to R, I want to use R in connection with a MySQL database. After installing (apparently sucessfully) the package RMySQL (R Version 1.6.2) the result is as follows: > library(RMySQL) > con <- dbConnect(MySQL(), dbname= "test") Error: couldn''t find function "dbConnect" Thank You in advance for help Peter Jörg Peter Baresel Technische