search for: iaw

Displaying 20 results from an estimated 152 matches for "iaw".

Did you mean: ian
2013 Feb 06
5
First R Package --- Advice?
...s way, I maintain only one file for each function, and the docs and code are together. sort of like knuth's literate programming and the numerical-recipees approach to keeping each function in its own file with equal name. I believe my "try-out and debug cycle" will then be $ cd iaw ## the package name and top directory is iaw $ perl weaveall.pl ## extract all man/*.Rd files code examples and place them in R/ $ R CMD INSTALL iaw $ R CMD check iaw good idea? bad idea? common? uncommon? I do not understand the namespace mechanism yet. I understand the NAMESPACE...
2011 Jul 02
5
%dopar% parallel processing experiment
...ut 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 seems pretty disappointing. the cores are not used for the most part, either. feedback appreciated. /iaw ---- Ivo Welch (ivo.welch at gmail.com)
2005 Dec 08
1
A few questions how to use libogg
1.) after initializing a ogg_stream_state may I just keep calling ogg_stream_packetin with valid ogg_packet's until no more ogg_packets needs to be added? Or do I need to call ogg_stream_pageout after every ogg_stream_packetin? Iaw may I delay calling ogg_stream_pageout until there are no more packets to be added? 2.) I assume I have call ogg_stream_pageout until no more pages can be created and then call ogg_stream_flush if there are still bits left to be 'paged'? 3.) Do I need to manually set the e_o_s of the l...
2012 Mar 30
4
list assignment syntax?
...uld like to do, in pseudo R+perl notation is f <- function(a,b) list(a+b,a-b) (c,d) <- f(1,2) and have c be assigned 1+2 and d be assigned 1-2. right now, I use the clunky x <- f(1,2) c <- x[[1]] d <- x[[2]] rm(x) which seems awful. is there a nicer syntax? regards, /iaw ---- Ivo Welch (ivo.welch at brown.edu, ivo.welch at gmail.com)
2004 Jan 22
4
Axes Ticks
...many ticks on my X axis. I want exactly 4 tickmarks. It would also be nicer if I could name the ticks. I looked at ?par and Venables&Ripley, and tried the lab and xaxp parameters. I could not figure out how to use them productively. could someone please let me know? help appreciated. /iaw
2004 Oct 15
4
pdf device --- axes labels text disappeared?
...;bug.eps" ); plot(Promise, Expect, type="b", ylim=c(0,60)); dev.off(); apologies if this has already been noted elsewhere---I looked but did not find it. (probably googled for the wrong terms, if so.) is this my bug, or R's bug or my R installation bug? help appreciated. /iaw
2006 Jul 11
3
--no-save and --save toggle from inside R? + BATCH stderr
...ike --silent would suppress this one line summary/error. This is not urgent---I can use the R return code to write a wrapper for this facility, but this might be nice default behavior. My guess is that most of us won't mind to see a flag in writing if something went badly wrong. sincerely, /iaw
2004 Jun 09
5
direct data frame entry
...bably be an example under data.frame (or read.table). of course, it is probably somewhere---just I have do not remember it and could not find it after 2 hours of searching. I also tried the r-help archives---at the very least, I hope we will get the answer there for future lookups. regards, /iaw
2011 Oct 10
5
multicore by(), like mclapply?
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 Welch (ivo.welch at gmail.com)
2013 Feb 07
4
Hard Stop?
is it possible to throw a stop() that is so hard that it will escape even tryCatch? /iaw ---- Ivo Welch (ivo.welch at gmail.com)
2013 Feb 26
1
Light Libraries
...ghtweight. There are probably dozens of little bugs, because I don't know or have not properly taken care of a variety of internal R code issues. still, I like how this ended up, and there is no learning curve, so I thought I would share it. I have put all my functions into a directory ~/src/iaw/R/ . In my standard .Rprofile, I thus first added a list of my libraries (well, I have just one) and invoke it: options(strict="very") Libdirs <- c("~/src/iaw/R/") for (libdir in Libdirs) { source( Sys.glob(paste0(libdir, "Rprofile"))) ) } (I prefer mnemonics...
2004 Mar 26
8
stop() vs. error() ?
...re done") print "Error in eval.with.vis(expr, envir, enclos) :" ? It would seem to me that a plain stop() is not an error, and that it would make more sense to have an error() function that is different from a stop(). Is there a rationale here that I am missing? sincerely, /iaw
2004 Jul 07
3
fast NA elimination ?
...nough for speed not to matter, and there I do not care whether my method is pretty inefficient (ok, I admit it: I use the sum() function and test whether the result is NA)---but now I have some bigger data sets. Is there a recommended method of doing NA elimination most efficiently? sincerely, /iaw --- ivo welch professor of finance and economics brown / nber / yale
2004 Aug 21
4
loadhistory() in .Rprofile ?
...r platform R releases, too. Is the .Rprofile now loaded before loadhistory()? if so, this seems to make it impossible to set up one big history file across directories (save history prior to exit, then reload automatically on entry). if not, I probably screwed something up---again. regards, /iaw --- ivo welch PS: my earlier amd64 gentoo problem was caused by my use of f2c, which apparently is not happy on amd64 platforms. thanks to those who let me know the problem.
2013 Feb 09
2
character strings with embedded commands: perl "/gee" ?
...cat("d is a", class(d), "with names", names(d)), 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.welch at gmail.com)
2004 Jun 20
4
if syntax
...out what was wrong. I eventually figured out that to resolve this ambiguity, I would guess that ifelse() would be a preferred function. I wanted to look up the internal R documentation for if via "?if", but this does not work. making the latter work would be a good idea. regards, /iaw --- ivo welch professor of finance and economics brown / nber / yale
2004 Nov 01
2
non-linear solve?
...nctions? > irr.in <- function(r, c1, c2, c3 ) { return(c1+c2/(1+r) + c3/(1+r)^2); } > solve.nonlinear( irr.in, -100, 60, 70 ); 0.189 If someone has written an irr function, this would be helpful, too---though not difficult to write, either. thanks for any pointers. Regards, /iaw --- ivo welch
2006 Mar 14
2
R CMD BATCH w/o inputs?
...he same output that I would see if I ran source("i.R"), but direct it to a file. I can of course direct R output to a file ($ R > myoutput), and then type the source and exit statements blindly, but there must be a better way---I just don't know it. what am I missing? regards, /iaw
2012 May 31
2
print.data.frame to string?
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.welch@gmail.com) [[alternative HTML version deleted]]
2010 Jan 08
4
fast lm se?
...not need. Or, I can compute (X' X)^(-1) s^2 myself. Has someone written a fast se() function? incidentally, I think this would make a nice addition to the R base. I presume it is not uncommon for a statistician also to want to use the se of coef estimates. pointers appreciated. regards, /iaw ---- Ivo Welch (ivo.welch@brown.edu, ivo.welch@gmail.com) [[alternative HTML version deleted]]