Re: [R] Using read.csv.sql() to read in specific columns

2014-09-22 Thread David Reiner
That seems right to me. You might want to look into a persistent connection as in Example 10 at https://code.google.com/p/sqldf/#Example_10._Persistent_Connections This will save reloading the DB for every query. You might even want to create a permanent DB as in Example 9. This is one of my

Re: [R] Simple permutation question

2014-06-27 Thread David Reiner
Just for reference, I like package iterpc, because it allows one to get one permutation or combination at a time. You can get all if you like, but for large N, it is sometimes better to iterate through the results to avoid creating a large object. Also, getall function returns a matrix so you

Re: [R] combinatorics for minimal set of samples

2014-03-14 Thread David Reiner
Perhaps this blog post will be of use: http://www.r-bloggers.com/generating-balanced-incomplete-block-designs-bibd/ HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of n.hub...@ncmls.ru.nl Sent: Friday, March 14, 2014

Re: [R] [SPAM] - Re: How do I identify non-sequential data? - Found word(s) list error in the Text body

2013-11-22 Thread David Reiner
Similar to Don MacQueen's: unsplit(lapply(split(DF, DF$ID), transform, cv = c(0, diff(YoS))), DF$ID) -- David Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lopez, Dan Sent: Thursday, November 21, 2013 6:38 PM

Re: [R] Color font in verbatim text output in Shiny

2013-10-07 Thread David Reiner
inline below. HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dimitri Liakhovitski Sent: Monday, October 07, 2013 11:04 AM To: r-help Subject: [R] Color font in verbatim text output in Shiny Hello! Is there any way

[R] C symbol name psmirnov2x not in load table

2013-06-20 Thread David Reiner
I'm working with some old code that worked under R 2.15.3 but gives an error under 3.0.0 and 3.0.1 : 1.0 - .C(psmirnov2x, p = as.double(10.0), as.integer(1000), as.integer(1000))$p Error in .C(psmirnov2x, p = as.double(10), as.integer(1000), as.integer(1000)) : C symbol name psmirnov2x not

Re: [R] Download data

2013-05-24 Thread David Reiner
Quandl package is your friend: library(Quandl) # download and install if necessary oil - Quandl('FRED/WCOILWTICO', type='xts') # Search the quandl.com site to make sure this is the data you want. # I just put in your text string 'WTI - Cushing, Oklahoma' and got several results which might be the

Re: [R] Download data

2013-05-24 Thread David Reiner
Actually I think the one you want is 'FRED/DCOILWTICO' -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Reiner Sent: Friday, May 24, 2013 8:46 AM To: Christofer Bogaso; r-help Subject: Re: [R] Download data Quandl

Re: [R] Can DEoptim trace output be customized?

2013-05-10 Thread David Reiner
developers and researchers. This package is really great! -- David From: Katharine Mullen [mailto:mullenk...@gmail.com] Sent: Thursday, May 09, 2013 2:01 PM To: David Reiner Cc: r-help@r-project.org Subject: Re: Can DEoptim trace output be customized? Dear David, The package doesn't have an option

[R] Can DEoptim trace output be customized?

2013-05-09 Thread David Reiner
I'm running DEoptim - it works great! (A HUGE THANK YOU to David Ardia, Katharine Mullen, Brian Peterson, and Joshua Ulrich, and Kris Boudt!!!). Sometimes I set trace to a number so I can see a few intermediate points in the optimization. However, I have a large number of variables and would

Re: [R] Issue when reading a table into R

2013-03-07 Thread David Reiner
Or if you just want to see what the table will look like when you read it but not clutter your workspace by assigning it, you can do View(head(read.table(filename),20)) -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

[R] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread David Reiner
I'm trying to use sqdf's function read.csv.sql to read CSV files in which the missing values are represented by NA's. Plain old read.csv works fine on these files, but they are rather large and I'd like to filter using sql-like statements. However, even if I specify field.types correctly and

Re: [R] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread David Reiner
:00,1357,20,1357,18,1357 2012-07-01,16:20:00,1357,20,1357,18,1357 2012-07-01,16:21:00,1357,20,1357,18,1357 -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Reiner Sent: Wednesday, September 05, 2012 4:32 PM To: r-help@r

Re: [R] Communative Matrix Multiplcation

2012-08-15 Thread David Reiner
As a mathematician, I have to correct the subject line to 'Distributive Matrix operations' -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Tuesday, August 14, 2012 12:55 PM To: Berend Hasselman Cc:

[R] Hmisc::pstamp, mfcol, and spacing

2012-04-30 Thread David Reiner
I am trying to make a nice 2x1 plot and add a timestamp with comment. The pstamp function from Hmisc works nicely when mfcol=c(1,1), but when mfcol=c(2,1), the stamp winds up in the wrong place: require('Hmisc') opar - par(mfcol=c(2,1)) plot(1:10) title(main=MAIN Title) plot(1:20)

Re: [R] where I can find more color names or color definition?

2012-03-16 Thread David Reiner
I found this useful: http://research.stowers-institute.org/efg/R/Color/Chart/ColorChart.pdf HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of FJ M Sent: Wednesday, March 14, 2012 3:39 PM To: totang...@gmail.com; R

Re: [R] orthogonal distance regression package?

2012-02-29 Thread David Reiner
My understanding is that TLS, EIV, and orthogonal regression are closely related but separate concepts. If you read the 'Talk' at the Wikipedia page referenced below, you will see that many people have terminology problems as well. My take is that TLS is a special case of EIV and orthogonal

Re: [R] decimal number format as quarter

2012-02-08 Thread David Reiner
Looks like something priced in eighths; we deal with similar notation for bonds and similar instruments. x - c(2.2, 2.4, 2.6, 3.2, 3.4, 3.6) as.integer(x)+10*(x-as.integer(x))/8 [1] 2.25 2.50 2.75 3.25 3.50 3.75 Adjust the 10 and 8 if you have other denominators. -- David -Original

Re: [R] Matrix/Vector manipulation

2011-10-03 Thread David Reiner
sum(ifelse(cumsum(W)=v, W, 0) * R) HTH, David L. Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of fernando.cabr...@nordea.com Sent: Monday, October 03, 2011 9:50 AM To: r-help@r-project.org Subject: [SPAM] - [R]

Re: [R] getting list of data.frame names

2011-10-03 Thread David Reiner
I know you already got a good answer from Joshua Wiley. Here is a function I find useful. Anyone who wants to suggest improvements, please do so! my.ls function(pos=1, sorted=FALSE, mode, class){ .result - sapply(ls(pos=pos, all.names=TRUE),

Re: [R] Optimal Code for subset of Integer Sets

2011-07-26 Thread David Reiner
If I understand you correctly, you are looking for partitions of an integer, so look at Robin Hankin's package 'partitions' David L. Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Pham Sent: Tuesday, July 26, 2011

Re: [R] [SPAM] - R equivalent to (D)QDAWO in Fortran? - Found word(s) list error in the Text body

2011-04-25 Thread David Reiner
dqdawo is an IMSL routine which is similar to QUADPACK's dqawo. (The initial d is for double precision), and maybe similar to NAG's d01anf. If you search for 'imsl qdawo' you should find some more description. On the other hand, the error messages may give someone enough information to help you

Re: [R] Millisecond TimeStamps

2011-03-24 Thread David Reiner
?strptime or ?options d1 - as.POSIXct(2009-09-30 10:00:00.543) d1 [1] 2009-09-30 10:00:00 CDT # Oh, yeah, I forgot op - options(digits.secs=6) # or 3 d1 [1] 2009-09-30 10:00:00.543 CDT # The accuracy was there already HTH, David L. Reiner, PhD Head Quant XR Trading LLC -Original

Re: [R] Replace for loop when vector calling itself

2011-03-07 Thread David Reiner
Isn't c(0, cumsum(diff(theoP)) ) just theoP - theoP[1] ? -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Monday, March 07, 2011 10:52 AM To: rivercode Cc: r-help@r-project.org Subject: Re: [R]

Re: [R] How to call subset in a for loop?

2011-01-26 Thread David Reiner
you were caught by the '=' versus '==' error ;-) and Henrique's elegant one-liner avoids the problem altogether. -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique Dallazuanna Sent: Wednesday, January 26, 2011 6:00

Re: [R] Problem in using bdh function for Govt tickers

2011-01-19 Thread David Reiner
That's a Bloomberg issue, not RBloomberg: use bdp() (point) instead of bdh() (history) or bds() (set) bdp(conn,ticker,c(PX_LAST,CPN)) PX_LAST CPN 912828JV Govt NA 0.875 912828JY Govt 100.0234 0.875 HTH, David L. Reiner XR Trading LLC -Original Message- From:

Re: [R] previous business day

2010-10-22 Thread David Reiner
you may be thinking of the timeDate package, which has some holiday calendars. HTH, David L. Reiner, PhD Head Quant XR Trading LLC -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Li, Jing Yi Sent: Thursday, October 21, 2010 3:51 PM

Re: [R] previous business day

2010-10-22 Thread David Reiner
Look at the documentation for timeDate and try ?timeNdayOnOrBefore after loading the package. -- David -Original Message- From: Li, Jing Yi [mailto:jingyi...@credit-suisse.com] Sent: Friday, October 22, 2010 9:38 AM To: David Reiner; David Winsemius Cc: r-help@r-project.org Subject

Re: [R] Pointing to a specific place on the x-axis with an arrow

2010-10-06 Thread David Reiner
Not sure which ones work in R, but I recently needed injection, surjection,and bijection arrows, and found them here : http://unicode.org/charts/#symbols HTH, David L. Reiner, PhD Head Quant XR Trading LLC -Original Message- From: r-help-boun...@r-project.org

Re: [R] pasting together 2 character arrays

2010-09-01 Thread David Reiner
Always good to have that fourth way, just in case (Array3 - as.vector(outer(Array2[-1], Array1, FUN=function(x, y) paste(y, Array2[1], x, sep=. [1] height.trt0.trt1 height.trt0.trt2 weight.trt0.trt1 weight.trt0.trt2 age.trt0.trt1age.trt0.trt2 [7] sex.trt0.trt1sex.trt0.trt2

Re: [R] regression line of 2 independent variables

2010-08-10 Thread David Reiner
If appropriate for your data, you could try errors-in-variables (package leiv) or use the first component from principal components. HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Monday, August 09,

Re: [R] [SPAM] - Reducing a list of functions by composition fails - Bayesian Filter detected spam

2010-08-05 Thread David Reiner
Funcall - function(f, ...) f(...) Reduce(Funcall,list(plus2,plus3,plus4),init=3,right=TRUE) [1] 12 Basically from the examples from ?Reduce. HTH, David L. Reiner XR Trading LLC -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mog

Re: [R] Reducing a list of functions by composition fails

2010-08-05 Thread David Reiner
OK: comp - function(x) Reduce(Funcall, list(plus2,plus3,plus4), init=x, right=TRUE) comp(3) [1] 12 but of course, Gabor's answer is more insightful and cleaner. -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mog