[R] xyz-contour plot (irregular grid)

2013-11-21 Thread ivo welch
easier.) sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] Newey West and Singular Matrix

2010-09-22 Thread ivo welch
dear R experts:  I am writing my own little newey-west standard error function, with heteroskedasticity and arbitrary x period autocorrelation corrections.  including my function in this post here may help others searching for something similar. it is working quite well, except on occasion, it com

Re: [R] Newey West and Singular Matrix + library(sandwich)

2010-09-23 Thread ivo welch
:41 PM, Achim Zeileis wrote: > On Wed, 22 Sep 2010, ivo welch wrote: > >> dear R experts:  I am writing my own little newey-west standard error >> function, with heteroskedasticity and arbitrary x period >> autocorrelation corrections.  including my function in this post

[R] more errors (behavior)

2010-10-24 Thread ivo welch
find the answer.) > a=c(2,3) > b=c(4,5,6,7) > a+b [1] 6 8 8 10 when I really want recycling, I would rather do it explicitly with rep. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mail

[R] programming questions

2010-11-03 Thread ivo welch
d just write "if (is.defined(d$z)". * is there a way to turn off automatic recycling? I would rather get an error than unexpected recycling. I can force recycling with rep() when I need to. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) _

Re: [R] programming questions

2010-11-03 Thread ivo welch
yikes. this is all my fault. it was the first thing that I ever defined when I started using R. is.defined <- function(name) exists(as.character(substitute(name))) I presume there is something much better... /iaw On Wed, Nov 3, 2010 at 2:12 PM, Erik Iverson wrote: > > > ivo

Re: [R] programming questions

2010-11-03 Thread ivo welch
xist either FALSE how would I define this function? regards, /iaw On Wed, Nov 3, 2010 at 2:48 PM, Barry Rowlingson wrote: > On Wed, Nov 3, 2010 at 6:17 PM, ivo welch wrote: >> yikes.  this is all my fault.  it was the first thing that I ever >> defined when I started using

Re: [R] programming questions

2010-11-03 Thread ivo welch
ed" variable name. how do I stringify in R? PS: btw, is it possible to weave documentation into my user function, so that I can type "?is.defined" and I get a doc page that I have written? Ala perl pod. I think I asked this before, and the answer was no. /iaw Ivo Welc

[R] Rd installation (not markup language) primer?

2010-11-03 Thread ivo welch
R parse the Rd files on demand? so, is there a primer on installing Rd files? /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

[R] "Nash Equilibrium"

2010-12-03 Thread ivo welch
es y1,y2,y3,..., and cares about (maximizes) pb(x1,x2,x3,...,y1,y2,y3) I can tune it to my problem, but if someone has already invented this, please point me to it, so that I do not have to reinvent the wheel. regards, /iaw Ivo Welch (ivo.we...@brown.edu,

[R] \ell symbol (log-likelihood)

2010-08-17 Thread ivo welch
Dear R experts---is it possible to plot the \ell symbol in R under the pdf device?  the following did not work: pdf(file="ell.pdf"); plot( c(0,1), c(0,1) ); text( 0.5, 0.5, "\u2113" ) dev.off() my guess is that this cannot be done, but I thought I would ask

[R] Date Inconsistencies? Buglets?

2010-08-20 Thread ivo welch
970-01-01"))) The lower axis is drawn from the plot() with dates. The upper axis from axis() is drawn with numbers, not dates. (PS: Is there an easier way to tell R that I want a whole lot more tick marks and/or labels than what it gives me by default?) regards, /iaw

[R] strange behavior of ifelse with factors

2010-08-20 Thread ivo welch
since it stumped me for a while (in a more complex program, of course), I thought I would drop this note. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Date Inconsistencies? Buglets?

2010-08-21 Thread ivo welch
21, 2010 at 6:04 AM, Jim Lemon wrote: > On 08/21/2010 12:35 AM, ivo welch wrote: >> >> ... >> (PS: Is there an easier way to tell R that I want a whole lot more >> tick marks and/or labels than what it gives me by default?) >> > Hi Ivo, > I haven't been

[R] on abort error, always show call stack?

2010-08-22 Thread ivo welch
ow, I sprinkle "cat" statements everywhere, just to locate the line where the error appears.) Of course, I would really love to see the line in my program that triggered this, but I have asked this before, and I understand this is too difficult to get into the R language. regards, /iaw

Re: [R] on abort error, always show call stack?

2010-08-22 Thread ivo welch
yes, thank you. is it possible to have it invoked to STDERR automatically on a program abort? /iaw On Sun, Aug 22, 2010 at 11:50 AM, Matt Shotwell wrote: > On Sun, 2010-08-22 at 11:41 -0400, ivo welch wrote: >> Dear R Wizards---is it possible to get R to show its current call

[R] unexpected subset select results?

2010-08-23 Thread ivo welch
m like unexpected behavior, though, without an error. there probably is some reason why this does not ring an alarm bell... /iaw ---- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] unexpected subset select results?

2010-08-23 Thread ivo welch
wrote: > > > ivo welch wrote: >> >> quizz---what does this produce? >> >>   d=data.frame( a=1:1000, b=2001:3000, z= 5001:6000 ) >>   attach(d); c <- (a+b)>25; detach(d) >>   d= subset(d, TRUE, select=c( a, b, c )) >> >> yes, I know I h

Re: [R] unexpected subset select results?

2010-08-24 Thread ivo welch
.  it does seem like unexpected behavior, >> though, without an error.  there probably is some reason why this does >> not ring an alarm bell... >> >> /iaw >> >> Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) >> >> __

[R] different interface to by (tapply)?

2010-08-30 Thread ivo welch
produce charid  m  s A          2  3 B          4  5 working with data frames is often more intuitive than working with the output of by(). the R wizards are probably chuckling now about how easy this is... regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.

Re: [R] different interface to by (tapply)?

2010-08-30 Thread ivo welch
quot;' into a data.frame /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) On Mon, Aug 30, 2010 at 9:36 AM, Henrique Dallazuanna wrote: > Try this: > > as.data.frame(by( indf, indf$charid, function(x) c(m=mean(x), s=sd(x)) )) > > On Mon, Aug 30, 2010 at 10:19 AM,

Re: [R] different interface to by (tapply)?

2010-08-30 Thread ivo welch
perfect. this is the R way to do it quick and easy. thank you, marc. (PS, in my earlier example, what I wanted was aggregate( . ~ key, data=indf, FUN = function(x) c(m=mean(x), s=sd(x))) ) Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) On Mon, Aug 30, 2010 at 10:47 AM, Marc

Re: [R] different interface to by (tapply)?

2010-08-30 Thread ivo welch
mercy!!! ;-) thanks, everyone. sure beats me trying to reinvent a slower version of the wheel. came in very handy. I think it would be nice to see some of these pointers in the "?by" manual page. not sure who to ask to do this, but maybe this person reads r-help. /iaw

[R] "Low Pain" Unicode Characters in pdf graph?

2011-05-15 Thread ivo welch
;) dev.off() (these are the characters that I need the most NOW, but this is a more generic question.) sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] R formula language---a min and max function?

2010-05-04 Thread ivo welch
Dear R experts---I would like to estimate a non-linear least squares expression that looks something like y ~ a+b*min(c,x) where a, b, and c are the three parameters. how do I define a min function in the formula language of R? advice appreciated. sincerely, /iaw _

Re: [R] R formula language---a min and max function?

2010-05-04 Thread ivo welch
ion. will figure this one out next. regards, /iaw On Tue, May 4, 2010 at 3:40 PM, David Winsemius wrote: > > On May 4, 2010, at 3:33 PM, ivo welch wrote: > >> Dear R experts---I would like to estimate a non-linear least squares >> expression that looks something like >

Re: [R] R formula language---a min and max function?

2010-05-04 Thread ivo welch
w 'minFactor' of 0.000976562 I really don't care about this example, of course---only about learning how to avoid nls() from dying on me. so, any advice would be appreciated. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) On Tue, May 4, 2010 at 3:59 PM, David

[R] non-linear estimation with many firm-specific parameters

2010-05-09 Thread ivo welch
PU (taking a few days, which would be ok), but overwhelm my memory, too. maybe it is just plain infeasible. has anyone seen someone else work on such a problem? sincerely, /ivo welch Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) _

[R] apply formula to data?

2010-05-11 Thread ivo welch
that is not even specified (i.e., y~x really is y~a+b*x). so, is there a reference to formula objects somewhere? sincerely, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] nls() and nls2() behavior?

2010-05-11 Thread ivo welch
not figure out how I have miscoded this. I hope the problem is obvious to regular users...thanks for any helpful eyes here. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Revolution R and the R Community?

2010-05-11 Thread ivo welch
here tried out their enterprise version on a linux machine, but it had ugly problems in the creation of the top-level Makefile. so, my initial impression is not overwhelming. are they for real? regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...

Re: [R] Revolution R and the R Community?

2010-05-11 Thread ivo welch
thank you, everybody, for enlightening me and others about the relationships involved. I hope Revolution R and other companies like it will succeed. I don't mind RR being free to academics---if nothing else, I like it for the fact that I can install RR without worry on a couple of different compu

[R] esthetics --- extending the lm command to fixed effects?

2010-05-20 Thread ivo welch
firmid ) does this already exists as a package? or has someone figured out how to program this? as I wrote---this is a curiosity question, not a substance question. regards, /iaw ---- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) [[alternative HTML version d

Re: [R] esthetics --- extending the lm command to fixed effects?

2010-05-20 Thread ivo welch
extend the lm() function? I googled "course notes on advanced programming Venables", but did not find it. Do you have a better link? (hopefully, this is a short explanation---I know the algorithm. I want to learn how to coax it into an lm statement.) regards, /iaw Ivo Welch

[R] Fixed Effects Estimations (in Panel Data)

2010-05-24 Thread ivo welch
mber of fixed effects, but work through averaging], but I presume that they do. this is of course useful for very large panel data sets with many thousands of fixed effects.) and, thanks, Yves and Giovanni for writing plm(). /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __

[R] passing local parameters to nls?

2010-06-09 Thread ivo welch
rmula, data=d, start=list(a=1, c=1), trace= TRUE); rm(b) cat("\nbut how do I pass a local parameter into my formula? \n"); f = function(c) nls( myformula, data=d, start=list(a=1, b=1), trace= TRUE) f(c=1); advice, as always, appreciated. /iaw Ivo Welch (ivo.we...@

[R] lm without error

2010-06-11 Thread ivo welch
iables contains only NA's. I believe I now cannot use lm(y ~ X), because one of the regressions will throw the lm.fit exception. (all the other y vectors should have worked.) or is there a way to get lm() to work in such situations? /iaw Ivo Welch (ivo.we...@brown.edu,

Re: [R] lm without error

2010-06-11 Thread ivo welch
aps ?try could help. > > ivo welch wrote: >> >> this is not an important question, but I wonder why lm returns an >> error, and whether this can be shut off.  it would seem to me that >> returning NA's would make more sense in some cases---after all, the >

[R] comparing reshape's

2010-06-11 Thread ivo welch
ted = melt( subset(mydataframe, select=c(yid,xid,zcontent), id=c("xid", "yid") ) outcome = cast( zcontent, xid ~ yid ) takes about 875 seconds. so, for large reshape jobs from long to wide, the reshape library is much more efficient. YMMV. /iaw I

[R] sleep timer resolution on OSX

2010-06-12 Thread ivo welch
it there instead.) hope this helps someone else... iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/postin

[R] foreach with registerDoMC on R 2.12.0 OSX 10.6 --- errors and warnings

2011-02-11 Thread ivo welch
some hints for the search engines. I just did install.packages("foreach") install.packages("doMC") library(doMC) registerDoMC() library(foreach) > foreach(i = 1:3) %dopar% sqrt(i) The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Br

[R] foreach() package for parallel computing

2011-02-27 Thread ivo welch
es.) regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) CV Starr Professor of Economics (Finance), Brown University http://welch.econ.brown.edu/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] inefficient ifelse() ?

2011-03-01 Thread ivo welch
d g() for all values first, and presumably then just picks left or right results based on t%%2. uggh... wouldn't it make more sense to evaluate only the relevant parts of each vector and then reassemble them? /iaw Ivo Welch __ R-help@r-project

Re: [R] inefficient ifelse() ?

2011-03-01 Thread ivo welch
t and iff functions will always be evaluated before the function call happens, even with lazy evaluation. :-( I still think that it makes sense to have a smarter vectorized %if% in a vectorized language like R. just my 5 cents. /iaw ---- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) O

Re: [R] inefficient ifelse() ?

2011-03-01 Thread ivo welch
27;t have to > think about those cases. > > Would you want it to depend only on a logical > vector or perhaps also on a factor (a vectorized > switch/case function)? > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -----Original Message- >>

[R] Merging by() results back into original data frame?

2011-03-21 Thread ivo welch
val=rnorm(9)) highestvals <- by( d, d$group, function(d)(max(d$val)) ) ## and now? iterate over levels( d$group ) ? how do I merge highestvals back into d? advice appreciated. sincerely, /iaw ---- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gma

Re: [R] Merging by() results back into original data frame?

2011-03-21 Thread ivo welch
thank you, william and bill. wow, this was fast. I have been tearing my hair out over this one, trying to work the wrong tool. (this would make a good "see also" in the "by" function.) Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) On Mon, Mar 21, 2011 at 7:0

[R] uniroot speed and vectorization?

2011-04-02 Thread ivo welch
package that does this? /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pro

[R] font (charter)

2011-08-10 Thread ivo welch
dear R-experts---can someone please refer me to the latest installation instructions for graphics fonts in R (the pdf device)? (I would like to install the Charter font from the texlive 2011 distribution under OSX.) sincerely, /iaw Ivo Welch (ivo.we...@gmail.com

Re: [R] font (charter)

2011-08-10 Thread ivo welch
e="testcharter.pdf") > plot( c(0,1), c(0,1) ) > text( 0.5, 0.5, "This is Bitstream Charter") > dev.off [h] use Adobe Acrobat -> File -> Properties to confirm that your new font is really Bitstream Charter. /iaw Ivo Welch (ivo.we...@gmail.com) __

[R] CairoPDF

2011-08-12 Thread ivo welch
arter font, though.) [2] pdf("testfile") creates a file without a .pdf extension. CairoPDF("testfile") creates testfile.pdf . not a big deal---just a small inconsistency if someone is switching from pdf to CairoPDF . regards, /iaw Ivo Welch (ivo.we...@gmail.com) PS: Trie

[R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-16 Thread ivo welch
, type="n" ) clr <- c("black", "red", "red", "black") for (i in 1:4) { hline <- function( yloc, ... ) for (i in 1:length(yloc)) lines( c(-1,6), c(yloc[i],yloc[i]), col="gray") hline(0.9); hline(1.0); hline(1.1); hline(1

Re: [R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-17 Thread ivo welch
user R code, I invoke it as library(cairo)), but also for others who may use it and be surprised when they run into the same issue, wondering if it is their code, or a more general issue.. /iaw Ivo Welch (ivo.we...@gmail.com) On Wed, Aug 17, 2011 at 5:18 AM, Gavin Simpson wrote: > On Tue

[R] CMYK color space

2011-09-13 Thread ivo welch
lor to map perfectly. I wonder whether I should switch to the tikzDevice. (I know it exists, but I have not used it yet. is it reliable and is it reasonably well comparable to pdf device capabilities) advice appreciated. sincerely, /ivo welch Ivo Welch (ivo.we...@gmail.com) http

Re: [R] CMYK color space

2011-09-13 Thread ivo welch
obviously not. thank you, henrik. going back to square 101. (I just googled, because I usually find stuff faster by googling. cmyk and R brought up nothing.) apologies for the bandwidth, everyone. Ivo Welch (ivo.we...@gmail.com) On Tue, Sep 13, 2011 at 4:24 PM, Henrik Bengtsson wrote

[R] pdf font example

2011-09-14 Thread ivo welch
TPATH=", absolute.path.to.font.files, sep="")   stopifnot(system( paste(commandline, paste(fname, ".PDF", sep=""), paste(fname, ".pdf", sep="") ) ) ==0 )   options( pdf.current= NULL ) } # and a test pdf.start("test-berasans") plot( 1:10

[R] print.data.frame to string?

2012-05-31 Thread ivo welch
dear R experts---is there a function that prints a data frame to a string? cat() cannot handle lists, so I cannot write cat("your data frame is:\n", df, "\n"). regards, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative

Re: [R] print.data.frame to string?

2012-05-31 Thread ivo welch
thanks, jeff. no, not capture.output(), but thanks for pointing me to it (I did not know it). capture.output flattens the data frame. I want the print.data.frame output, so that I can feed it to cat, and get reasonable newlines, too. regards, /iaw Ivo Welch (ivo.we...@gmail.com) J. Fred

Re: [R] print.data.frame to string?

2012-05-31 Thread ivo welch
great. thanks. exactly what I wanted. /iaw Ivo Welch (ivo.we...@gmail.com) On Thu, May 31, 2012 at 2:53 PM, David L Carlson wrote: > a <- data.frame(x=runif(4), y=runif(4), z=runif(4)) > b <- capture.output(a) > c <- paste(b, "\n", sep=""

[R] %dopar% parallel processing experiment

2011-07-02 Thread ivo welch
on my Mac Pro 3,1 (2 quad-cores), R 2.12.0, which reports 8 cores, "plain" takes about 68 seconds (real and user, using the unix timing function). "do-onecore" takes about 300 seconds. "do-multicore" takes about 210 seconds real, (300 seconds user). this see

Re: [R] %dopar% parallel processing experiment

2011-07-02 Thread ivo welch
? regards, /iaw 2011/7/2 Uwe Ligges : > > > On 02.07.2011 19:32, ivo welch wrote: >> >> dear R experts--- >> >> I am experimenting with multicore processing, so far with pretty >> disappointing results.  Here is my simple example: >> >>

[R] Speed Advice for R --- avoid data frames

2011-07-02 Thread ivo welch
frame into a matrix, do the operations, and then copy them back. not ideal, either. In my opinion, this is an R design flow. Data frames are the fundamental unit of much statistical analysis, and should be fast. I think R lacks any indexing into data frames. Turning on indexing of data fram

Re: [R] %dopar% parallel processing experiment

2011-07-02 Thread ivo welch
of dealing with multiple processes. is this interpretation correct? regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ 2011/7/2 Uwe Ligges : > > > On 02.07.2011 20:04, ivo welch wrote: >> >> thank you, uwe.  this is a little disappointing.  paral

Re: [R] Speed Advice for R --- avoid data frames

2011-07-02 Thread ivo welch
fs---which is most people considering to adopt R. /iaw ---- Ivo Welch (ivo.we...@gmail.com) 2011/7/2 Uwe Ligges > Some comments: > > the comparison matrix rows vs. matrix columns is incorrect: Note that R has > lazy evaluation, hence you construct your matrix in the timing for the

[R] manipulating "by" lists and "ave()" functions

2011-07-08 Thread ivo welch
erwrites every entry. I guess I can keep only the first column of a, and add it to d, but this seems a rather ugly and inefficient way. How is this done better? Question 3: repeat question 2, but keep both the intercept and the slope. thanks in advance, as

Re: [R] manipulating "by" lists and "ave()" functions

2011-07-08 Thread ivo welch
r-help-boun...@r-project.org > > [mailto:r-help-boun...@r-project.org] On Behalf Of ivo welch > > Sent: Friday, July 08, 2011 3:43 PM > > To: r-help > > Subject: [R] manipulating "by" lists and "ave()" functions > > > > dear R wizards---more igno

[R] split data frame temporary and work with only part of it?

2011-07-24 Thread ivo welch
s the recommended way? sincerely, /iaw ---- Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide comm

[R] embedding data frame in R code?

2012-08-02 Thread ivo welch
iles. I could put each column into its own vector and then combine into a data frame, but this seems ugly. is there a better way to embed data frames? I searched for the answer via google, but could not find it. it wasn't obvious in the data import/export guide. re

[R] options(errorfn=traceback)

2011-11-24 Thread ivo welch
Dear R experts---I may have asked this in the past, but I don't think I figured out how to do this. I would like to execute traceback() automatically if my R program dies---every R programI ever invoke. I guessed that I could have wrapped my entire R code into tryCatch( ... oodles of R code ,

[R] error death with backtrace --- how to "exit (0)"

2011-11-29 Thread ivo welch
Dear R experts---I think I need to figure out how to stop in my error function without triggering an error again. so, I think I need the equivalent of C's exit(0) call. Here is what I mean: $ R CMD BATCH die.R and die.R is # in my .Rprofile, but for now in die.R options(error=function(e) print

[R] fast or space-efficient lookup?

2011-10-09 Thread ivo welch
then loop over the main data set to supplement it. is there a recommended way of doing such tasks in R, either super-fast (so that I merge many many times) or space efficient (so that I merge once and store the results)? sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) _

Re: [R] fast or space-efficient lookup?

2011-10-09 Thread ivo welch
which I couldn't do this AT ALL. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Sun, Oct 9, 2011 at 10:42 AM, Patrick Burns wrote: > I think you are looking for the 'data.table' > package. > > On 09/10/2011 17:31, ivo welch wrote: >> >> D

[R] multicore by(), like mclapply?

2011-10-10 Thread ivo welch
dear r experts---Is there a multicore equivalent of by(), just like mclapply() is the multicore equivalent of lapply()? if not, is there a fast way to convert a data.table into a list based on a column that lapply and mclapply can consume? advice appreciated...as always. regards, /iaw Ivo

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread ivo welch
that makes all splits. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Oct 10, 2011 at 11:07 AM, Joshua Wiley wrote: > Hi Ivo, > > My suggestion would be to only pass lapply (or mclapply) the indices. > That should be fast, subsetting with data table should also be fast

[R] SLOW split() function

2011-10-10 Thread ivo welch
odes further. am I doing something wrong? is there an alternative to split()? sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] SLOW split() function

2011-10-10 Thread ivo welch
course, knowing how to do this myself fast now by hand, this is not so important for me. but it may help some other novices. thanks again everybody. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Oct 10, 2011 at 9:31 PM, William Dunlap wrote: > The following avoids the

Re: [R] SLOW split() function

2011-10-11 Thread ivo welch
how to get coef standard errors faster in this case. summary.lm() is really slow. regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance Anderson School at UCLA, C519 On Mon, Oct 10, 2011 at 11:30 PM, Joshua Wiley wrote: >

[R] simplified multicore by() function

2011-10-22 Thread ivo welch
dear R readers---I thought I would post the following snippet of R code that makes by() like operations easier and faster on multicore machines for R novices and amateurs. I hope it helps some. YMMV. feel free to ignore. PS: I wish R had a POD-like documentation system for end users that are not

[R] curiosity only: gpu ?

2011-10-30 Thread ivo welch
ve unified memory space, so the data copy problem is hopefully long gone. /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] mc.cores and computer settings on osx and linux

2011-11-11 Thread ivo welch
gh it does have good package documentation. it does have some unexpected behavior: mymatrix[1:2,] is a matrix, but mymatrix[1:1,] is a numeric. huh? data.table is necessary for reasonably fast data manipulation, but data.table giveth and taketh. it has some really strange unexpected behavior---mydatatab

[R] "source" option

2012-03-23 Thread ivo welch
fter any R program print/abort sequences have played out. besides, "sink=TRUE, split=TRUE" could be a nice additional option to "source". sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] _

[R] assigning vector or matrix sparsely (for use with mclapply)

2012-03-26 Thread ivo welch
ide the FUN.ON.ROWS, but this is costly in terms of execution time. are there obvious solutions? advice appreciated. regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] assigning vector or matrix sparsely (for use with mclapply)

2012-03-27 Thread ivo welch
ound # this is where I had given up, but the following works: > new.data=old.data > new.data[recalc.please]= old.data[recalc.please]^2 > new.data [1] 11 144 13 196 15 256 17 324 19 400 sorry, guys. /iaw Ivo Welch (ivo.we...@gmail.com) On Tue, Mar 27, 2012 at 7:27 PM, ilai wro

[R] list assignment syntax?

2012-03-30 Thread ivo welch
d <- x[[2]] rm(x) which seems awful. is there a nicer syntax? regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] list assignment syntax?

2012-03-30 Thread ivo welch
nt. #4 is exactly what I wanted. can list[] be added into the standard core R as a feature? it would seem like a natural part of the syntax for functions returning multiple values. justin---mea culpa. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Fri, Mar 30, 2012 at 5:08 PM, Justin Ha

Re: [R] list assignment syntax?

2012-03-31 Thread ivo welch
like me, plus the google archives here, are angels. without your help, I could not use R.] Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

Re: [R] list assignment syntax?

2012-04-03 Thread ivo welch
where I got it right. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Sat, Mar 31, 2012 at 8:35 AM, ivo welch wrote: > "what is the problem you are trying to solve?" > > elegance, ease, and readability in my programs. > > R has morphed from a data manipulation, gr

[R] multi-machine parallel setup?

2012-04-18 Thread ivo welch
listener processes on each of my slaves by hand. R would start slave processes automatically on each slave that has a a listener running. I don't have the time/ability to set up full clustering quasi-supercomputer solutions. /iaw ---- Ivo Welch (ivo.we...@gmai

Re: [R] multi-machine parallel setup?

2012-04-20 Thread ivo welch
Sys.sleep(1); x } ) # on both, please iaw On Wed, Apr 18, 2012 at 1:01 PM, ivo welch wrote: > Dear R experts: > > could someone please point me to a page that explains how to set up > more than 1 machine for library parallel (which is quickly becoming my > favorite!) ... _

Re: [R] multi-machine parallel setup?

2012-04-21 Thread ivo welch
Indices, stopCluster bash: /Library/Frameworks/R.framework/Resources/bin/Rscript: No such file or directory but if I use two linux machines, it works. now, how do I use parallel's mclapply with it? best, /iaw Ivo Welch (ivo.we...@gmail.com) J. Fred Weston Professor of Finance Anderson S

Re: [R] multi-machine parallel setup?

2012-04-21 Thread ivo welch
thx, guys, almost there. This is good fodder for the vignette or ?parallel. Steps: (1) install package "snow" on all machines which you want to be part of a cluster. (2) run under R library(parallel) cl <- makeCluster(c("localhost", "calc.localdomain"), "SOCK") result <- parLapply(cl=cl, X=1:10

[R] linear model benchmarking

2012-04-22 Thread ivo welch
I cleaned up my old benchmarking code and added checks for missing data to compare various ways of finding OLS regression coefficients. I thought I would share this for others. the long and short of it is that I would recommend ols.crossprod = function (y, x) { x <- as.ma

[R] big quasi-fixed effects OLS model

2012-05-08 Thread ivo welch
fixed effects). could someone please point me to packages, if any, that would help me estimate such models? (can these problems be split over many different cores?) advice appreciated. /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) CV Starr Professor of Economics (Finance), Brown

[R] x86 SSE* Pointer Favors

2008-06-12 Thread ivo welch
Dear Statisticians--- This is not even an R question, so please forgive me. I have so much ignorance in this matter that I do not know where to begin. I hope someone can point me to documentation and/or a sample. I want to compute a covariance as quickly as non-humanly possible on an Intel core

[R] recursive beta with cutoffs on large data set

2008-06-15 Thread ivo welch
dear R experts: I have an academic question that borders on asking for consulting help, so I hope I am not too imposing. If I am, please ignore me. My data set has 100MB data set of daily stock returns. I want to compute rolling (recursive?) betas---either bivariate or multivariate---with respe

[R] R 2.70 + ps2pdf14

2008-05-17 Thread ivo welch
dear R graphics experts---if anyone is running the combination of R 2.7.0 and ghostscript (2.62), could you please run the following and let me know if you get the same strange symbol size that I do, or if there is something weird on my system?regards, /ivo pdf(file = "testhere.PDF", version

Re: [R] R 2.70 + ps2pdf14

2008-05-18 Thread ivo welch
; wrote: > G'day Ivo, > > On Sat, 17 May 2008 21:33:35 -0400 > "ivo welch" <[EMAIL PROTECTED]> wrote: > >> dear R graphics experts--- > > Not belonging to this group, but can confirm that I can see the same, > in particular the circles are changing

Re: [R] R 2.70 + ps2pdf14

2008-05-20 Thread ivo welch
thanks. I am now using R-patched 2008-05-18 r45723 . This is probably intended, but if not, I wanted to note it briefly: on the pdf output device, symbol 1 is always black, no matter what color is selected. symbols 10 and 13 contain black. symbol 19 is the replacement for symbol 1 that takes on

[R] basic boxplot questions

2009-01-16 Thread ivo welch
dear R experts: I am playing with boxplots for the first time. most of it is intuitive, although there was less info on the web than I had hoped. alas, for some odd reason, my R boxplots have some fat black dots, not just the hollow outlier plots. Is there a description of when R draws hollow v

[R] Mac ARM for lm() ?

2024-11-14 Thread Ivo Welch
I have found more general questions, but I have a specific one. I have a few million (independent) short regressions that I would like to run (each reg has about 60 observations, though they can have missing observations [yikes]). So, I would like to be running as many `lm` and `coef(lm)` in para

<    1   2   3   >