Re: [R] parallel number of cores according to memory?

2020-07-08 Thread ivo welch
no, I'm not. mostly conventional use afaik. if this should not be happening, I can trace it down to a small reproducible example to figure it out. -- Ivo Welch (ivo.we...@ucla.edu) -- Ivo Welch (ivo.we...@ucla.edu) http://www.ivo-welch.info/ J. Fred Weston Distinguished Professor of Finance

Re: [R] parallel number of cores according to memory?

2020-07-07 Thread ivo welch
ugghhh---apologies. although in 2020, it would be nice if the mailing list had an automatic html filter (or even bouncer!) I am using macos. alas, my experiments suggest that `mclapply()` on a 32-core intel system with 64GB of RAM, where the input data frame is 8GB and the output is about 500MB

[R] parallel number of cores according to memory?

2020-07-07 Thread ivo welch
if I understand correctly, R makes a copy of the full environment for each process. thus, even if I have 32 processors, if I only have 64GB of RAM and my R process holds about 10GB, I should probably not spawn 32 processes. has anyone written a function that sets the number of cores for use (in

[R] Learning to Write R Packages (Libraries) with Documentation

2019-02-17 Thread Ivo Welch
I would like to put together a set of my collected utility functions and share them internally. (I don't think they are of any broader interest.) To do this, I still want to follow good practice. I am particularly confused about writing docs. * for documentation, how do I refer to '@'-type

[R] bracketing for optimize

2018-05-31 Thread ivo welch
dear R wizards: `optimize()` requires the user to provide the brackets. I can write a bracketing routine, given a function and a starting point, but I was wondering whether there was already a "standard" user-exposed implementation. (Presumably, this is used in nlm, too; alas, nlm is in C, not

Re: [R] lattice contourplots

2015-06-01 Thread ivo welch
Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance Anderson School at UCLA, C519 Director, UCLA Anderson Fink Center for Finance and Investments Free Finance Textbook, http://book.ivo-welch.info/ Editor, Critical Finance Review, http://www.critical

[R] lattice contourplots

2015-06-01 Thread ivo welch
+y)) quartz() contourplot( z ~ x * y, data = d) am I committing an error, or is there something more robust or at least verbose, perhaps? help appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ __ R-help@r

[R] combine trellis lattice contour plot with simple plot() points() and text() commands?

2015-06-01 Thread ivo welch
at adjacent points, pretending that they are linear, and mark where a line between them intercepts the level, and then hope that some sanity prevents me from connecting disconnected levels. not my plan...] Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info

[R] Finding Optimum of Stochastic Function

2015-05-18 Thread ivo welch
, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] kaveri with R on GPU?

2014-04-17 Thread ivo welch
does anyone have a kaveri based system with R recompiled to use its GPU? is this even possible today? regards, /iaw PS: I am trying to collect benchmarks http://r.ivo-welch.info/ Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted

[R] better an error?

2014-04-10 Thread ivo welch
despite its drawbacks; but IMHO it is just too much to ask from a set of bewildered novice master students. I hope the R team will at some point in the future pick up on making the core language less mysterious upon setting an option, at least in user space. /iaw Ivo Welch (ivo.we

[R] xyz-contour plot (irregular grid)

2013-11-21 Thread ivo welch
then be 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] contour plot axis correspondence

2013-11-16 Thread ivo welch
. as with everything in R, it probably exists, but I did not find it. my above code had to map MX (with x,y,z columns) into a matrix first. advice appreciated. best, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https

[R] get syntax for inherited environments

2013-09-05 Thread ivo welch
. do I write a while loop to look back, or is there a standard R function that searches all calling environments until it finds one that works? regards, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r

[R] new.env() and attach for write?

2013-08-28 Thread ivo welch
the globalenv, run my code, see what objects have been changed (how?), move the changed and new functions into my a environment, and then restore globalenv. or is this already done somewhere else? /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted

Re: [R] new.env() and attach for write?

2013-08-28 Thread ivo welch
duh! Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance Anderson School at UCLA, C519 Director, UCLA Anderson Fink Center for Finance and Investments Free Finance Textbook, http://book.ivo-welch.info/ Editor, Critical Finance Review, http

[R] model syntax processed --- probably common

2013-08-19 Thread ivo welch
such vectors don't keep a name attribute of some sort. there is probably an R way of doing this. is there? /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] model syntax processed --- probably common

2013-08-19 Thread ivo welch
)) or whatever. the output in both cases should be the same, preferably even knowing that the name of the variable is really x and not nm. is there a standard common way to do this? regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance

[R] C Interface in R

2013-07-17 Thread ivo welch
below. best to be ignored. /iaw Ivo Welch (ivo.we...@gmail.com) --- the as75.R file, at least as of july 2013 ### see end of file for documentation debug - 0 if (debug) cat(rep(\n,10)) ## visual separation dyn.load(Ras75.so) # created with R CMD SHLIB -o Ras75.so Ras75.c

[R] memory allocation and management question

2013-07-15 Thread ivo welch
is obvious.) regards, /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

Re: [R] memory allocation and management question

2013-07-15 Thread ivo welch
thx, jim. makes perfect sense now. I guess a logical in R has a few million possible values ;-). (Joke. I realize that 4 bytes is to keep the code convenient and faster.) regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jul 15, 2013 at 4:26 PM, jim holtman jholt...@gmail.com wrote

[R] advice on big panel operations with mclapply?

2013-07-02 Thread ivo welch
bigmemory? or SQL? or ... ? I am leaning towards the SSD solution. am I overlooking some simpler recommended solution? /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] R Benchmarks

2013-06-28 Thread ivo welch
Dear R group: I just bought a Haswell i7-4770k machine, so I went through the trouble of creating a small website with some comparative benchmarks. I also made it easy for others to contribute benchmarks. if you are interested, it's all at http://R.ivo-welch.info/ . enjoy. /iaw Ivo Welch

[R] canonical AR1 w/ measurement error - pointers?

2013-06-20 Thread ivo welch
a gazillion times. could someone please point me to some simple textbook = howto treatments of this problem and/or R packages that implement this? feel free to point out your own work...this way I can cite it. regards, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted

Re: [R] canonical AR1 w/ measurement error - pointers?

2013-06-20 Thread ivo welch
thanks, mark. these are excellent starting pointers. I will get to them asap. I hope I won't need to bother you more. regards, /iaw [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] load() into a data frame with my chosen name = .ThisEnv ?

2013-06-17 Thread ivo welch
} results - mclapply( 1:1, run ) stumped over something that should be easy...pointer appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] read.csv timing

2013-06-10 Thread ivo welch
not help with read.csv, however. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jun 10, 2013 at 10:09 AM, ivo welch ivo.we...@gmail.com wrote: Surely you know the types of the columns? If you specify it in advance, read.table and relatives will be much faster. Duncan Murdoch thx, duncan

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread ivo welch
is useful only for big files anyway. is it possible to block write.csv across multiple threads in mclapply? or hook a single-thread function into the mclapply collector? /iaw On Wed, Jun 5, 2013 at 5:06 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 13-06-05 12:08 AM, ivo welch wrote: thx

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-04 Thread ivo welch
that a built-in R filter function could provide. Ivo Welch (ivo.we...@gmail.com) On Tue, Jun 4, 2013 at 2:56 PM, Greg Snow 538...@gmail.com wrote: Some possibilities using existing tools. If you create a file connection and open it before reading from it (or writing to it), then functions

[R] read.csv and write.csv filtering for very big data ?

2013-06-03 Thread ivo welch
for parallel lapply?) presumably, to keep it simple, mcfilter.csv would keep a counter of read chunks and block write chinks until the next sequential chunk in order arrives. just a suggestion... /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r

[R] Rcpp Starter With Carry Class

2013-05-28 Thread ivo welch
) { RLeaveMeAlonePointer out; out.attr(class) = silly; return out; } and is R smart enough to call C++ ~silly() when the last reference to x disappears? and is the overhead of a C++ call low or high? /iaw Ivo Welch (ivo.we...@gmail.com

[R] updating observations in lm

2013-05-27 Thread ivo welch
. before I get started on this, I just wanted to inquire whether someone has already written such a function. regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] updating observations in lm

2013-05-27 Thread ivo welch
models, not observations. even if it did, given the speed of lm(), I don't think it will be that useful. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, May 27, 2013 at 9:26 AM, Bert Gunter gunter.ber...@gene.com wrote: Ivo: 1. You should not be fitting linear models as you describe

Re: [R] updating observations in lm

2013-05-27 Thread ivo welch
Gentlemans as 274 algorithm allows weights, so adding an obs with a weight of -1 would do the trick of removing obs, too. This may be a good job for hadwell wickhams c code interface. On May 27, 2013 12:47 PM, Berend Hasselman b...@xs4all.nl wrote: On 27-05-2013, at 17:12, ivo welch ivo.we

Re: [R] curiosity: next-gen x86 processors and FP32?

2013-05-26 Thread ivo welch
. ivo welch ivo.we...@anderson.ucla.edu wrote: dear R experts: although my question may be better asked on the HPC R mailing list, it is really about something that average R users who don't plan to write clever HPC-optimized code would care about: is there a quantum performance leap on the horizon

[R] curiosity: next-gen x86 processors and FP32?

2013-05-25 Thread ivo welch
i7 by going to FP32? regards, /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 commented

[R] reading large csv data sets efficiently

2013-05-22 Thread ivo welch
, colClasses=c(NA, NA, NULL, NULL, numeric,numeric, numeric, numeric), na.strings=c(C,B))) does R first read the entire file and then worry about colClasses and na.strings, or does it handle this line by line as it goes? (if it does the former, I can write a perl pre-filter) /iaw Ivo Welch

[R] what does summary(polr(...)) really call?

2013-05-13 Thread ivo welch
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 commented, minimal, self-contained, reproducible code.

Re: [R] what does summary(polr(...)) really call? --- and obscure buglet

2013-05-13 Thread ivo welch
)) print(head(pairs)) ## works p - polr( y ~ x , method=probit, data=pairs) print(summary(p)) pairs is saved as a name. eventually, summary.polr thinks it is the pair function, not the pair data frame. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, May 13, 2013 at 11:43 AM, Achim Zeileis

Re: [R] R's basic lm() and summary.lm functions

2013-05-11 Thread ivo welch
for. more generally, I am still wondering why we have an lm and a summary.lm function, rather than just one function and one resulting object for parsimony, given that the summary.lm function is fast and does not increase the object size. Ivo Welch (ivo.we...@gmail.com) docs[[lm]] - c

[R] R's basic lm() and summary.lm functions

2013-05-10 Thread ivo welch
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 commented, minimal, self-contained, reproducible

Re: [R] R's basic lm() and summary.lm functions

2013-05-10 Thread ivo welch
I ended up wrapping my own new ols() function in the end. it is my replacement for lm() and summary.lm. this way, I don't need to alter internals. in case someone else needs it, it is included. of course, feel free to ignore. docs[[ols]] - c(Rd= ' @TITLE ols.R @AUTHOR ivo.we...@gmail.com

[R] ecdf --- title suggestion and question

2013-05-08 Thread ivo welch
figure out how to get rid of the title altogether. attr(ee,call) - NULL gives me two quotation marks () . is it possible to remove the title altogether? regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https

Re: [R] ecdf --- title suggestion and question

2013-05-08 Thread ivo welch
ooops...never mind. I mixed up title and main as options. Ivo Welch (ivo.we...@gmail.com) On Wed, May 8, 2013 at 1:54 PM, Steve Lianoglou lianoglou.st...@gene.com wrote: Hi Ivo, On Wed, May 8, 2013 at 1:37 PM, ivo welch ivo...@gmail.com wrote: dear R-experts---first, a suggestion

[R] pR2 stumped

2013-05-06 Thread ivo welch
' not found. 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 commented, minimal, self-contained

Re: [R] categorized complete list of R commands?

2013-04-04 Thread ivo welch
Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ [[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

Re: [R] categorized complete list of R commands?

2013-04-04 Thread ivo welch
-parse the .Rd files that are strewn around my hard drive, or whether there is an idiomatic R way... best, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] categorized complete list of R commands?

2013-04-03 Thread ivo welch
; and another categorization for importance (e.g., like common for lm and obscure for ..). Such categorizations require intelligence. if I am going to do this for myself, I think a csv spreadsheet may be a good idea to make it easy to resort by keys. regards, /iaw Ivo Welch (ivo.we

Re: [R] identifying and drawing from T distribution

2013-03-16 Thread ivo welch
actually, I had it right all along. that is, m- runif(); s- runif(); df-runif()*10+1 # get some parameters...any parameters x - rt( 10, df )*s + m # create random draws library(MASS) fitdistr(x, t) # confirm properties will work. (josh suggested working with the skewness parameter, ncp,

[R] identifying and drawing from T distribution

2013-03-15 Thread ivo welch
, or is there a better way to do this? there is a non-centrality parameter ncp in rt, but one parameter ncp cannot subsume two (m and s), of course. my first attempt was to draw rt(..., df=2.63)*s+m, but this was obviously not it. advice appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) http

[R] R Compiler Options in the linux (ubuntu) Binaries? AVX?

2013-03-04 Thread ivo welch
curiosity question: I was wondering whether the R binaries and BLAS libraries for ubuntu linux are compiled using SSE4 and AVX support. this probably can go a long way towards a unified memory bus GPGPU substitute. Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info

Re: [R] Light Libraries

2013-02-26 Thread ivo welch
, and a couple of others to have helped me out many times to solve problems I have run into. without r-help, I would have given up on it. regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ On Tue, Feb 26, 2013 at 6:35 AM, Uwe Ligges lig...@statistik.tu-dortmund.de

[R] Parallelizing Other Apply Functions, e.g. by, the Easy (Wrong?) Way

2013-02-26 Thread ivo welch
run the risk that the R team could change by(). I wish I could at least test whether the by() function changes from release to release to alert me, but functions are not atomic and therefore cannot be compared. what is the recommended way to do this? /iaw Ivo Welch (ivo.we...@gmail.com

[R] Light Libraries

2013-02-25 Thread ivo welch
function that does what I want, but R seems flexible enough to do almost anything. I have a sketch of [b], thanks to Neal Fultz, but not of [a]. I hope this organizational design helps some others. regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ http://www.ivo

Re: [R] character strings with embedded commands: perl /gee ?

2013-02-09 Thread ivo welch
to be of length x, but this is another story. /iaw On Fri, Feb 8, 2013 at 4:01 PM, ivo welch ivo.we...@anderson.ucla.edu wrote: dear R experts---I am trying to replicate a perl feature. I want to be able to embed R commands inside a character string, and have the string be printed

Re: [R] First R package, advice

2013-02-09 Thread ivo welch
/editor would understand my new format. I do not have the skills to tell emacs how to switch syntax-highlighting in the middle of files. this collective path-dependence will plague us for decades, having created a cost without a benefit. /iaw Ivo Welch (ivo.we...@gmail.com

[R] simple pdf font embedding example for Bera

2013-02-08 Thread ivo welch
in the hard work to make this possible. [PS: The above may be incorrect in terms of encoding, dingbats (symbols), or other issues. I just checked that the basics worked.] regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list

[R] character strings with embedded commands: perl /gee ?

2013-02-08 Thread ivo welch
)), but I also want to be define %or% so that I can write (is.data.frame(d)) %or% d is a ::class(d):: with names ::names(d):: ; operators don't take variable arguments afaik. :-(. advice appreciated. regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R

Re: [R] First R Package --- Advice?

2013-02-06 Thread ivo welch
than .Rd and more heavyweight than just '#' comments. /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

[R] Hard Stop?

2013-02-06 Thread ivo welch
is it possible to throw a stop() that is so hard that it will escape even tryCatch? /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

[R] First R Package --- Advice?

2013-02-05 Thread ivo welch
program, but that's not possible.) /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 commented

Re: [R] First R Package --- Advice?

2013-02-05 Thread ivo welch
. similarly, rstudio is a really nice IDE, but I don't think that roxygen2 and devtools need rstudio. could someone point me to a simpler starting document for roxygen2 and devtools, if such exists? regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston

Re: [R] First R Package --- Advice?

2013-02-05 Thread ivo welch
actually, I may have found what I was looking for in https://github.com/hadley/devtools/wiki/Philosophy --- 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

[R] width of terminal resize to current dimensions on linux Gnome terminal

2013-01-29 Thread ivo welch
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 commented, minimal, self-contained, reproducible

Re: [R] multiple versions of function

2013-01-09 Thread ivo welch
:00 AM, David Winsemius dwinsem...@comcast.net wrote: On Jan 7, 2013, at 6:58 PM, ivo welch wrote: hi david---can you give just a little more of an example? the function should work with call by order, call by name, and data frame whose columns are the names. /iaw It is I who should

[R] multiple versions of function

2013-01-07 Thread ivo welch
to parse an '...' argument, but there could be a couple of magical R functions that might make this easier than I would do it with my planned clunky version. what's the elegant version? /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r

Re: [R] multiple versions of function

2013-01-07 Thread ivo welch
hi david---can you give just a little more of an example? the function should work with call by order, call by name, and data frame whose columns are the names. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jan 7, 2013 at 4:25 PM, David Winsemius dwinsem...@comcast.net wrote: On Jan 7

[R] parallel error message extraction (in mclapply)?

2012-12-28 Thread ivo welch
for mclapply? /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ __ 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

[R] parallelized version of by and ave

2012-12-24 Thread ivo welch
( split( ds, factor ), FUN ) I don't know the poor man's version of ave. sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] vectorized uni-root?

2012-11-08 Thread ivo welch
Weylandt michael.weyla...@gmail.com wrote: On Thu, Nov 8, 2012 at 3:05 PM, ivo welch ivo.we...@gmail.com wrote: dear R experts--- I have (many) unidimensional root problems. think loc.of.root - uniroot( f= function(x,a) log( exp(a) + a) + a, c(.,9e10), a=rnorm(1) ) $root (for some

[R] embedding data frame in R code?

2012-08-02 Thread ivo welch
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. regards, /iaw Ivo Welch (ivo.we...@gmail.com

[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 HTML version deleted

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 dcarl...@tamu.edu wrote: a - data.frame(x=runif(4), y=runif(4), z=runif(4)) b - capture.output(a) c - paste(b, \n, sep=) cat(Your data set is:\n, c, \n

[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] 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 -

Re: [R] multi-machine parallel setup?

2012-04-21 Thread ivo welch
: 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 School at UCLA, C519 http://www.ivo-welch.info/ Editor, Critical Finance Review, http

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:100,

Re: [R] multi-machine parallel setup?

2012-04-20 Thread ivo welch
iaw On Wed, Apr 18, 2012 at 1:01 PM, ivo welch ivo.we...@gmail.com 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!) ... __ R

[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...@gmail.com

Re: [R] list assignment syntax?

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

Re: [R] list assignment syntax?

2012-03-31 Thread ivo welch
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-project.org/posting-guide.html and provide commented, minimal

[R] list assignment syntax?

2012-03-30 Thread ivo welch
]] 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 posting guide http://www.R

Re: [R] list assignment syntax?

2012-03-30 Thread ivo welch
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 Haynes jto...@gmail.com

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

2012-03-27 Thread ivo welch
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 ke...@math.montana.edu wrote: It is (at least

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

2012-03-26 Thread ivo welch
? 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 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

[R] source option

2012-03-23 Thread ivo welch
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-help@r-project.org mailing

[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)

[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] mc.cores and computer settings on osx and linux

2011-11-11 Thread ivo welch
manipulation, but data.table giveth and taketh. it has some really strange unexpected behavior---mydatatable[,1] is not the second column, as one would expect it to be. yes, it is documented, but syntax should be as expected.] /iaw Ivo Welch (ivo.we...@gmail.com

[R] curiosity only: gpu ?

2011-10-30 Thread ivo welch
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 do read the posting

[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

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 jwiley.ps

[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 jwiley.ps...@gmail.com 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

[R] SLOW split() function

2011-10-10 Thread ivo welch
()? 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 commented, minimal, self

Re: [R] SLOW split() function

2011-10-10 Thread ivo welch
Ivo Welch (ivo.we...@gmail.com) On Mon, Oct 10, 2011 at 9:31 PM, William Dunlap wdun...@tibco.com wrote: The following avoids the overhead of data.frame methods (and assumes the data.frame doesn't include matrices or other data.frames) and relies on split(vector,factor) quickly splitting

[R] fast or space-efficient lookup?

2011-10-09 Thread ivo welch
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) __ R-help@r

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

2011-10-09 Thread ivo welch
Ivo Welch (ivo.we...@gmail.com) On Sun, Oct 9, 2011 at 10:42 AM, Patrick Burns pbu...@pburns.seanet.com wrote: I think you are looking for the 'data.table' package. On 09/10/2011 17:31, ivo welch wrote: Dear R experts---I am struggling with memory and speed issues.  Advice would

[R] pdf font example

2011-09-14 Thread ivo welch
:10, 1:10, xlab=This is bera sans text) pdf.end() 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

  1   2   >