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
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 don
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 4
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
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 t
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 "psmirnov
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 da
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
not be negative; set to 'TRUE'")
> trace <- TRUE
> }
Feel free to ignore or incorporate this change.
Thanks to all the DEoptim developers and researchers.
This package is really great!
-- David
From: Katharine Mullen [mailto:mullenk...@gmail.com]
Sent: Thursday,
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 lik
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 Sar
16:19: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-h
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 nrow
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
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)
> t
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
Subj
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 line
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 Mes
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),
function(..x)object.size(eval(as.symbol(..x
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] Matrix/Vect
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 5:
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
?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
-
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] Replac
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 A
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:
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
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
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 [mailto:r-help-boun...@r-pro
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.trt1""age.trt0.trt2"
[7] "sex.trt0.trt1"
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,
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
> 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 M
33 matches
Mail list logo