Christopher A. Simon | 17 May 22:06 2012
Picon

RODBC Debugging

We are trying to attach R to our ODBC driver via RODBC. Unfortunately
we're getting Segmentation faults in odbcConnect (error detailed
below). We would like to attach a debugger to whatever process is
communicating with UnixODBC/our driver, but are not sure where to
start. R itself seems to be a large bash script, ideally we could
inject "gdb --args" before the execution of some process in that
script to get the desired results. Any guidance is much appreciated.

> library(RODBC)
> odbcConnect("sql1010odbc",uid = "uname", pwd = "pword")

 *** caught segfault ***
address 0x100000abb, cause 'memory not mapped'

Traceback:
 1: .Call(C_RODBCDriverConnect, as.character(connection), id,
as.integer(believeNRows))
 2: odbcDriverConnect(st, ...)
 3: odbcConnect("sql1010odbc")

--

-- 
__________________________________________

Christopher Alex Simon
__________________________________________

(831) 239 0636

113 Cedar Apt 5A

(Continue reading)

Mark Moon | 17 May 16:59 2012

RMySQL frustrations

Getting frustrated using R with MySQL (on Debian Squeeze).  I can 
connect to mySQL database and I can execute simple queries.  But, having 
various difficulties executing queries with multiple statements 
separated by ";".  Set the client.flag to CLIENT_MULTI_STATEMENTS but 
still having difficulties.

Questions: are the RMySQL and RODBC packages really meant just for 
simple, one line queries?  Can anyone point me to where I might learn 
how to execute more complicated queries with in R?

Thanks!

Mark

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Andreas Voellenklee | 9 May 16:05 2012
Picon

RMySQL, DBI: unrecognized MySQL field type 7 in column

Hello,

when I query a MySQL database using the commands

  con <- dbConnect(MySQL(), user=dbuser, password=dbpasswd,
dbname=dbname, host=dbhost)
  df <- dbGetQuery(con, sql)

I get the following message when a table contains the timestamp type:

RS-DBI driver warning: (unrecognized MySQL field type 7 in column 1
imported as character)

I googled and found a post on this mailing list from 2006:
https://stat.ethz.ch/pipermail/r-sig-db/2006q3/000221.html

Obviously this is still not fixed. Are there any plans to do so?

Thanks,
Andreas

> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=de_CH.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=de_CH.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C                 LC_NAME=C
(Continue reading)

Brandenburger, Thomas | 19 Apr 17:11 2012
Picon

SQL scoring code

Greetings,
I'm not sure if this is the right list for this subject so if not please point me there.  rpart() and some other R
libraries now have model scoring output in PMML through the pmml library.  I do some consulting in
predictive modeling and often the companies require SQL case statement code or C# or some other language. 
I know there are things such as the Oracle solution for in database scoring but this is somewhat different
in that typically the IT shops will want the scoring code as the deliverable and then run it natively in the
data warehouse they have.  Most (all?) commercial data mining and modeling packages have SQL as one of the
options for scoring code.  SAS eMiner for instance can deliver code in several languages.  So can Angoss,
KXEN, etc.

Does anyone know of an equivalent to the pmml library in  SQL?

Thomas Brandenburger
Assistant Professor
Department of Mathematics and Statistics
South Dakota State University
Cell: 605.480.0951
Fax: 605.688.5880
thomas.brandenburger@...<mailto:thomas.brandenburger@...>

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

siddharth arun | 14 Apr 16:58 2012
Picon

How to plot a smooth curve from a given set of data

--

-- 
Siddharth Arun,
4th Year Undergraduate student
Industrial Engineering and Management,
IIT Kharagpur
Contact No. - +91 9475432678

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Anthony S Fischbach | 27 Mar 20:50 2012
Picon

Reading date time fields from MS Access

I understand that reading date time fields through ODBC can be 
problematic.

When reading a table containing several MS Access date time fields, some 
are correctly read, others are not.

In the snippet below, both DateTimeFld1 and DateTimeFld2 are formatted 
identically within 
MS Access.  When read in through RODBC date times in the first field are 
truncated to dates, 
but the second field imports correctly.

I have tried this from both MS Access .mdb and .accdb files, and tried 
both the
odbcConnect and odbcConnectAccess2007 functions with the same results.
When using odbcConnect, I have specified a dsn created by 
C:\Windows\SysWOW64\odbcad32.exe driver?

Please advise if there may be a solution to reliably handle date time 
fields from MS Access.

Snippet:
> myMSAccessCnx<-"D:/TEMP/TEST.accdb"
> data.ch<-odbcConnectAccess2007(myMSAccessCnx, uid="afischbach")
> data.ch
> Test_tbl<-sqlFetch(data.ch, "Test_tbl")
> Test_tbl[1,]
     PK   DateTimeFld1    DateTimeFld2 
1 41910   2004-04-26      2004-04-27 02:00:00

(Continue reading)

siddharth arun | 27 Mar 01:25 2012
Picon

Return on CRSP

Can any one tell how can I find return on the CRSP equally-weighted
protfolio from a given set of data from CRSP?

--

-- 
Siddharth Arun,
4th Year Undergraduate student
Industrial Engineering and Management,
IIT Kharagpur
Contact No. - +91 9475432678

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

siddharth arun | 27 Mar 01:22 2012
Picon

How to forecast using GARCH function

I want to forecast using GARCH function.
Can any one help how to do it?

--

-- 
Siddharth Arun,
4th Year Undergraduate student
Industrial Engineering and Management,
IIT Kharagpur
Contact No. - +91 9475432678

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

Lescai, Francesco | 20 Mar 13:28 2012
Picon
Picon

SQLite - inserting a row conditional on its existence

Hi there,
I'm pretty new to the use of R with a newly created schema SQLite database.

I've been looking to the vignettes and to some examples, but I couldn't find a pretty basic task: i.e.
inserting a row in a table only if it doesn't exist.
if it does, I would either update or do nothing.

this is a simple table in my database
> res <- dbSendQuery(db, "SELECT * from variation")
> fetch(res)
  variation_id  name reference_allele validation_status
1            1 rs123                A     not_validated
2            2 rs234                C         validated
3            3 rs345                T     not_validated

and this the small test dataframe I'd like to insert data from
variants=data.frame(variation_id=c(1,2,3),name=c("rsNN","rsXX", "rs123"),
reference_allele=c("A","C","T"), validation_status=c("not_validated","validated","not_validated"))

based on SQL commands I was tempted to write something like

dbBeginTransaction(db)
query <- paste('IF NOT EXISTS (SELECT * FROM variation WHERE name = :name)',
               'INSERT INTO "variation"',
               "VALUES(NULL, :name, :reference_allele, :validation_status);")
dbGetPreparedQuery(db, query, bind.data=variants)

but I got the error
Error in sqliteExecStatement(con, statement, bind.data) :
  RS-DBI driver: (error in statement: near "IF": syntax error)
(Continue reading)

Sai Munikuntla | 15 Mar 16:31 2012

RStudio Server ROracle internal error

I've setup RStudio server and pointed it to use an existing R (2.13) installation. ROracle works fine when
accessed from R, but the same does not work from RStudio web-interface.

>library(ROracle)

Loading required package: DBI
>Oracle()

Error in .oci.Driver() : ROracle internal error [rociDrvInit, 1, -1]

"/etc/rstudio/rserver.conf" has rsession-which-r=/usr/local/R/bin/R
rsession-ld-library-path=/u01/app/oracle/product/11.1.0/db_1/lib:/u01/app/oracle/product/11.1.0/db_1

There is an existing path environment variable defined
$ env |grep LD_LIB* =/u01/app/oracle/product/11.1.0/db_1/lib:/u01/app/oracle/product/11.1.0/db_1

RStudio web-interface was giving me the above mentioned issue. I added the path in rserver.conf and
restarted the RStudio server but the problem still exists.

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-DB mailing list -- R Special Interest Group
R-sig-DB@...
https://stat.ethz.ch/mailman/listinfo/r-sig-db

jose luis cañadas | 6 Mar 22:27 2012
Picon

roracle in linux

Hello.
This is a copy of my email to r-sig-deb

I'm trying install roracle in my debian 64 bit system. I've read the
http://cran.r-project.org/web/packages/ROracle/INSTALL and I've
installed Oracel Instant Client by rpm package (using alien to deb convert).

When I try to install I write

  export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH

in terminal and then I download ROracle_1.1-1.tar.gz from cran and I
type sudo R CMD INSTALL ROracle_1.1-1.tar.gz where I've downloaded the
tar.gz file.

I always get the same error
jose <at> jose-laptop:~/Descargas$ sudo R CMD INSTALL ROracle_1.1-1.tar.gz
* installing to library '/usr/local/lib/R/site-library'
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
configure: error: OCI libraries not found
ERROR: configuration failed for package 'ROracle'
* removing '/usr/local/lib/R/site-library/ROracle'

and I don't understand why. any idea?

Thanks.

	[[alternative HTML version deleted]]

(Continue reading)


Gmane