[R] htmlParse (from XML library) working sporadically in the same code

2013-03-20 Thread Andre Zege
I am using htmlParse from XML library on a paricular website. Sometimes code fails, sometimes it works, most of the time id doesn't and i cannot see why. The file i am trying to parse is  http://www.londonstockexchange.com/exchange/prices-and-markets/international-markets/indices/home/sp-500.htm

[R] tidy.source() gets confused when # is not a comment but a part of a literal string?

2013-02-16 Thread Andre Zege
I needed to clean someone else code and run it through tidy.source. It encountered a number of hangups which after some experimentation lead me to suspect that the culprit is # symbol when it is a part of literal string. For example if i copy the following to the clipboard confuse.tidy <-    fu

Re: [R] failure to connect to Bloomber using Rbbg from batch script on Windows

2013-02-05 Thread Andre Zege
John, thanks for your reply. Batch job fails always. I tried running interactively at the same time as batch tries and at different times. Interactively, job always works. I set log level to "finest", but it didn't seem to add new anything to logs. I included new log messages below just in case

[R] failure to connect to Bloomber using Rbbg from batch script on Windows

2013-02-05 Thread Andre Zege
I am having a puzzling problem with bloomberg connection. When i  run from R prompt some code that has library(Rbbg) conn <- blpConnect(throw.ticker.errors = FALSE) print("connected") ... I establish connection every time and then proceed to get data when i run this code from R prompt. Ho

[R] foreach takes foreever?

2013-01-21 Thread Andre Zege
I started to look at ways to improve times of certain very parallel tasks and thought that foreach should be a valid candidate to do the job. So, i opened foreach tutorial by Steve Weston and started timing examples from it. First example from tutorial is  >system.time(for(i in 1:10) sqrt(i

[R] lubridate concatenation issue

2012-11-15 Thread Andre Zege
I took a look at Hadley's lubridate which seems a very neat package, but i am having a small problem with  concatenating lubridates to build vectors of it. Namely when function c( )  is applied to lubridate seems to change time to a local timezone in this particular case changing the date to pre

Re: [R] RJDBC doesn't load Oracle driver?

2010-11-26 Thread Andre Zege
Hmm, for the sake of anyone who steps on the same mine. Basically, this class error always say that you need to install latest java. It's not enough to get new jre -- you need to get full latest jdk as well. After that you need to do R reconfiguration, which is done by R CMD javareconf Then you ne

Re: [R] RJDBC doesn't load Oracle driver?

2010-11-26 Thread Andre Zege
I asked my local java export and his reply was that the driver was compiled with the later version of java that i need to install. I did install it in parallel to existing java and changed JAVA_HOME variable to point to new java directory. I also pre-pended PATH with path to java. Still, when i tr

[R] RJDBC doesn't load Oracle driver?

2010-11-24 Thread Andre Zege
I am having trouble loading Oracle JDBC driver into RJDBC. Basically, i installed RJDBC and used it to connect to MySql. However, when i try to load JDBC Oracle driver, it gives me an error message > drv<-JDBC("oracle.jdbc.driver.OracleDriver", "/pathToDriver/ojdbc6.jar") Error in .jfindClass(as

[R] RJDBC doesn't load Oracle driver?

2010-11-24 Thread Andre Zege
After installing RJDBC on RedHat Linux and using it successfully with mySQL JDBC driver i am trying to use it with Oracle database. I use the JDBC driver that works fine elsewhere (use it in DBVizualizer). However, when i try to load the driver, drv<-JDBC("oracle.jdbc.driver.OracleDriver", "/hom

[R] how to debug (mtrace) a function defined inside a function?

2010-10-29 Thread Andre Zege
Hi, everyone. I am using a fair amount of closures in my code. Problem i am experiencing is i cannot figure out how to mtrace functions defined within a function. There must be some way to name such function for mtrace to see it and let me step into it. For example, say i have code mymodel<-func