[R] how to debug a sudden exit in non-interactive mode

2004-09-03 Thread Vadim Ogranovich
Hi, I have a piece of R code that calls mgcv::gam. The code runs fine in the interactive mode, but terminates R w/o a single message when run non-interactively. Though I think I should be able to locate the problem by brute force I'd appreciate an advise how to do it more intelligently using R

RE: [R] memory in R

2004-10-11 Thread Vadim Ogranovich
Setting A - NULL doesn't immediately release the memory, the memory is actually released in gc(), which R calls for you at some random time. In situations like this I explicitely call gc() and do not wait for R to do this, e.g A - NULL; gc() Hope this helps, Vadim -Original Message-

RE: [R] Statistical analysis of a large database

2004-10-14 Thread Vadim Ogranovich
I thought that maybe authors of books on R should be allowed (encouraged ?) to announce availability/revisions of their books via the R-packages list? For example I'd be very interested to have another look at Dr. Torgo's book when it becomes more complete and I'd appreciate a revision notice

[R] 2d approx

2004-10-14 Thread Vadim Ogranovich
Hi, I am looking for a function that generalizes 'approx' to two (or more) dimensions. The references on the approx help page point toward splines, but a) splines is what I am trying to avoid in the first place and b) splines (except for mgcv splines) seem to be one dimensional. Here is a more

[R] passing formula arg to mgcv::gam

2004-09-27 Thread Vadim Ogranovich
Hi, I have a function, callGam, that fits a gam model to a subset of a dataframe. The argument to callGam is a formula, the subset is determined inside the function itself. My naïve approach generates and error, see below. I guess this is because 'idx' is loocked up in the environment of

RE: [R] passing formula arg to mgcv::gam

2004-09-27 Thread Vadim Ogranovich
-1.9.1 on RH-7.3. Thanks, Vadim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vadim Ogranovich Sent: Monday, September 27, 2004 3:24 PM To: [EMAIL PROTECTED] Subject: [R] passing formula arg to mgcv::gam Hi, I have a function, callGam

[R] private on site R training solicited

2004-09-27 Thread Vadim Ogranovich
in delivering the class please e-mail me the info for consideration. Thanks, Vadim Ogranovich Evnine Vaughan Assoc. [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] help.search intersection

2004-10-19 Thread Vadim Ogranovich
Hi, Is it possible to search for help pages that meet more than one criteria at a time? Say I want to search for all help pages that mention cross-validation AND bootstrap. How do I do this? Thanks, Vadim [[alternative HTML version deleted]]

[R] computing distribution function online

2004-10-25 Thread Vadim Ogranovich
Hi, I am looking for a means to compute empirical distribution function for a very large data set and evolution of that edf with time. Here are some specifics. Each day I have an estimate of a distribution function and a new sample of about 1e4 points from the distribution in question. I want

RE: [R] R code debugging

2004-11-09 Thread Vadim Ogranovich
You might want to check out the debug package on CRAN: debug: MVB's debugger for R Debugger for R functions, with code display, graceful error recovery, line-numbered conditional breakpoints, access to exit code, flow control, and full keyboard input. Version:1.0.1 Depends:R (=

[R] R on 64-bit Linux machine

2004-11-12 Thread Vadim Ogranovich
Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. My specific question is on which

RE: [R] R on 64-bit Linux machine

2004-11-15 Thread Vadim Ogranovich
Thanks to everyone for the info. It is very valuable. I am a little bit uneasy about conflicting reports regarding RHEL 3, but I guess at this point I just need to try and see. It's also very soothing to know that there is an official 64-bit build on CRAN. Thanks again for taking time to answer,

RE: [R] Enormous Datasets

2004-11-18 Thread Vadim Ogranovich
Very unlikely R will be able to handle this. The problems are: * the data set may simply not fit into the memory * it will take forever to read from the ASCII file * any meaningful analysis of a dataset in R typically require 5 - 10 times more memory than the size of the dataset (unless you are a

[R] how to get to interesting part of pattern match

2004-11-18 Thread Vadim Ogranovich
Hi, I am looking for a way to extract an interesting part of the match to a regular expression. For example the pattern [./](*.) matches a substring that begins with either . or / followed by anything. I am interested in this anything w/o the . or / prefix. If say I match the pattern against

[R] recursive penalized regression

2005-01-18 Thread Vadim Ogranovich
Hi, Few days ago I posted a question to r-sig-finance, which I thought would be an easy one. To my surprise I have received no replies, which makes me think that it is either harder than I thought, or that it makes no sense. I am reposting the message (with some modifications) on the R-help in a

RE: [R] Finding runs of TRUE in binary vector

2005-01-27 Thread Vadim Ogranovich
Untested: c(TRUE, b[-1] != b[-length(b)]) gives you the (logical) indexes of the beginnings of the runs c(b[-1] != b[-length(b)], TRUE) gives you the (logical) indexes of the ends of the runs -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Davis

[R] total variation penalty

2005-03-02 Thread Vadim Ogranovich
Hi, I was recently plowing through the docs of the quantreg package by Roger Koenker and came across the total variation penalty approach to 1-dimensional spline fitting. I googled around a bit and have found some papers originated in the image processing community, but (apart from Roger's

RE: [R] how modify object in parent.env

2005-03-08 Thread Vadim Ogranovich
Assign() re-binds the value, not modifies it (the latter is what I needed) -Original Message- From: McGehee, Robert [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 3:48 PM To: Vadim Ogranovich; r-help@stat.math.ethz.ch Subject: RE: [R] how modify object in parent.env

RE: [R] how modify object in parent.env

2005-03-09 Thread Vadim Ogranovich
) Vadim Ogranovich vograno at evafunds.com writes: : : Assign() re-binds the value, not modifies it (the latter is what I : needed) : : -Original Message- : From: McGehee, Robert [mailto:Robert.McGehee at geodecapital.com] : Sent: Tuesday, March 08, 2005 3:48 PM : To: Vadim

RE: [R] Survey of moving window statistical functions - still looking f or fast mad function

2005-04-01 Thread Vadim Ogranovich
Hi, First, let me thank Jaroslaw for making this survey. I find it quite illuminating. Now the questions: * the #1 solution below (based on cumsum) is numerically unstable. Specifically if you do the runmean on a positive vector you can easily get negative numbers due to rounding errors.

RE: [R] How to search an element in matrix ?

2005-04-10 Thread Vadim Ogranovich
A matrix is a vector as well (it is stored by columns), so it has two ways of indexing [i,j] and [i]. It may be easier for you to use the latter, thus which(x == 1) returns all indexes where the matrix x is equal to 1. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

RE: [R] recover should send messages to stderr, not stdout

2004-05-12 Thread Vadim Ogranovich
-Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 11, 2004 11:21 PM To: Vadim Ogranovich Cc: R-Help Subject: Re: [R] recover should send messages to stderr, not stdout ... Note that some of us consider recover() to be designed

[R] test for end of file on connection

2004-05-11 Thread Vadim Ogranovich
Hi, I am looking for a function to test for end-of-file on a connection. Apparently this question was already asked a couple of years ago and then P. Dalgaard suggested to look at help(connections), help(readLines). Unfortunately, I couldn't find such a function on those pages, maybe I am

[R] dump.frames in non-interactive mode

2004-05-07 Thread Vadim Ogranovich
Hi, recover() resorts to dump.frames() when called in non-interactive sessions. However dump.frames() still puts the dump into last.dump object and not into a file, which brings the question of how to get hold of the object once the session terminates. I guess the supposed answer is that

RE: [R] error in file(file, r): all connections are in use

2004-05-04 Thread Vadim Ogranovich
If you open a connection within a function it is often a good idea to set an on.exit expression that will close the connection. This will be called even if your function terminates via stop(). Here is an example: con - file(foo) open(con) on.exit(close(con), add=TRUE) HTH, Vadim

[R] skip lines on a connection

2004-05-01 Thread Vadim Ogranovich
Hi, I am looking for an efficient way of skipping big chunks of lines on a connection (not necessarily at the beginning of the file). One way is to use read lines, e.g. readLines(1e6), but a) this incurs the overhead of construction of the return char vector and b) has a (fairly remote)

RE: [R] skip lines on a connection

2004-05-01 Thread Vadim Ogranovich
on a connection ?seek Vadim Ogranovich vograno at evafunds.com writes: : : Hi, : : I am looking for an efficient way of skipping big chunks of lines on a : connection (not necessarily at the beginning of the file). One way is to : use read lines, e.g. readLines(1e6), but a) this incurs the overhead

RE: [R] skip lines on a connection

2004-05-01 Thread Vadim Ogranovich
, May 01, 2004 5:28 PM To: Vadim Ogranovich; [EMAIL PROTECTED] Subject: RE: [R] skip lines on a connection Your scan() call doesn't work because default argument what=0; i.e., it expects numeric data. You probably can just use what=. The other alternative is to just loop readLines() n times

[R] seek(..., origin='current') doesn't work on gzfile

2004-05-03 Thread Vadim Ogranovich
HI, It seems that seek(..., origin='current') doesn't properly work on gzfile connections, while it does work properly on ordinary files. # open a connection and repeatedly increment current position by 13 chars. Note that the read position does not move con - gzfile(foo.gz); open(con)

[R] ifelse when test is shorter than yes/no

2004-05-20 Thread Vadim Ogranovich
Hi, It turns out that the 'test' vector in ifelse(test, yes, no) is not recycled if it is shorter than the other arguments, e.g. ifelse(TRUE, seq(10), -seq(10)) [1] 1 Is there any particular reason it is not recycled? If there is one indeed a warning message might be in order when someone

RE: [R] ifelse when test is shorter than yes/no

2004-05-20 Thread Vadim Ogranovich
with the help page) w/o a warning. Thanks, Vadim -Original Message- From: Liaw, Andy [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 2:20 PM To: Vadim Ogranovich; R-Help Subject: RE: [R] ifelse when test is shorter than yes/no From: Vadim Ogranovich Hi

RE: [R] Using R in C++

2004-05-26 Thread Vadim Ogranovich
Look at Writing R Extensions guide. It covers both R-from-C and C-from-R. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörgen Wallerman Sent: Wednesday, May 26, 2004 3:09 AM To: '[EMAIL PROTECTED]' Subject: [R] Using R in C++ Hello, Is

[R] C-level try-catch

2004-06-01 Thread Vadim Ogranovich
Hi, Is there a C-level equivalent of tryCatch? I want to be able to intercept errors generated inside functions like allocVector(), SET_STRING_ELT(), etc. They all are probably generated by error(char *, ...), but this is just a guess. Thanks, Vadim [[alternative HTML version

[R] fast mkChar

2004-06-08 Thread Vadim Ogranovich
Hi, To speed up reading of large (few million lines) CSV files I am writing custom read functions (in C). By timing various approaches I figured out that one of the bottlenecks in reading character fields is the mkChar() function which on each call incurs a lot of garbage-collection-related

RE: [R] fast mkChar

2004-06-08 Thread Vadim Ogranovich
)allocates the heap memory if necessary. Here the setChar() macro is safe since s[i]-s are all brand new and thus are not shared with any other object. -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 1:23 PM To: Vadim Ogranovich Cc: R-Help

RE: [R] fast mkChar

2004-06-09 Thread Vadim Ogranovich
:[EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 3:35 PM To: Vadim Ogranovich Cc: R-Help Subject: Re: [R] fast mkChar Vadim Ogranovich [EMAIL PROTECTED] writes: I am no expert in memory management in R so it's hard for me to tell what is and what is not doable. From reading the code

[R] memory allocation and interrupts

2004-06-11 Thread Vadim Ogranovich
Hi, A recent discussion on the list about tryCatch and signals made me think about memory allocation and signals in C extension modules. What happens to the memory allocated by R_alloc and Calloc if the user pressed Ctr-C during the call? R-ext doesn't seem to discuss this. I'd guess that

[R] mkChar can be interrupted

2004-06-14 Thread Vadim Ogranovich
Hi, As was discussed earlier in another thread and as documented in R-exts .Call() should not be interruptible by Ctrl-C. However the following code, which spends most of its time inside mkChar, turned out to be interruptible on RH-7.3 R-1.8.1 gcc-2.96: #include Rinternals.h #include R.h

RE: [R] mkChar can be interrupted

2004-06-14 Thread Vadim Ogranovich
-Original Message- From: Luke Tierney [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 1:30 PM To: Vadim Ogranovich Cc: R-Help Subject: Re: [R] mkChar can be interrupted Not sure why you think this suggest mkChar can be interrupted. If you want to figure out how

RE: [R] mkChar can be interrupted

2004-06-14 Thread Vadim Ogranovich
, are not supposed to handle interrupts in any way? Thanks, Vadim From: Luke Tierney [mailto:[EMAIL PROTECTED] On Mon, 14 Jun 2004, Vadim Ogranovich wrote: From: Luke Tierney [mailto:[EMAIL PROTECTED] ... Not sure why you think this suggest mkChar can be interrupted

RE: [R] mkChar can be interrupted

2004-06-14 Thread Vadim Ogranovich
() and R_alloc() stand up against long jumps? Thanks, Vadim -Original Message- From: Luke Tierney [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 5:43 PM To: Vadim Ogranovich Cc: R-Help Subject: RE: [R] mkChar can be interrupted On Mon, 14 Jun 2004, Vadim Ogranovich wrote

RE: [R] mkChar can be interrupted

2004-06-14 Thread Vadim Ogranovich
(), but might be a problem in interrupt handlers (I am not an expert though). Thanks, Vadim -Original Message- From: Luke Tierney [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 7:46 PM To: Vadim Ogranovich Cc: R-Help Subject: RE: [R] mkChar can be interrupted On Mon, 14 Jun 2004

[R] setGeneric / standardGeneric when args are not literals

2004-06-18 Thread Vadim Ogranovich
Hi, This works setGeneric(clear, function(obj) standardGeneric(clear)) [1] clear but this doesn't. Why? funName - clear setGeneric(funName, function(obj) standardGeneric(funName)) Error in .recursiveCallTest(body, fname) : (converted from warning) The body of the generic function for

[R] setGeneric / standardGeneric when args are not literals - corrected

2004-06-18 Thread Vadim Ogranovich
This is a correction to my previous message, I forgot to swap two lines in the body of setMakeGenericMethod. Sorry about that. The correct (full message) reads like this: Hi, This works setGeneric(clear, function(obj) standardGeneric(clear)) [1] clear but this doesn't. Why? funName -

RE: [R] naive question

2004-06-29 Thread Vadim Ogranovich
R's IO is indeed 20 - 50 times slower than that of equivalent C code no matter what you do, which has been a pain for some of us. It does however help read the Import/Export tips as w/o them the ratio gets much worse. As Gabor G. suggested in another mail, if you use the file repeatedly you can

RE: [R] naive question

2004-07-01 Thread Vadim Ogranovich
: Thursday, July 01, 2004 5:22 PM To: [EMAIL PROTECTED] Subject: RE: [R] naive question As part of a continuing thread on the cost of loading large amounts of data into R, Vadim Ogranovich [EMAIL PROTECTED] wrote: R's IO is indeed 20 - 50 times slower than that of equivalent C code

[R] error when calling debugger()

2004-08-09 Thread Vadim Ogranovich
Hi, I am getting an error message when I am trying to run the debugger() on the last.dump. The debugger() stops after I make a selection. Could someone please suggest what it might mean? The R log is included below. This is R-1.8.1 on RH 7.3. Thanks, Vadim load(last.dump.rda)

[R] on.exit() inside local()

2004-08-09 Thread Vadim Ogranovich
Hi, Since I routinely open files in a loop I've developed a habit of using on.exit() to close them. Since on.exit() needs to be called within a function I use eval() as a surrogate. For example: for (fileName in c(a, b)) eval({ con - file(fileName); on.exit(close(con)) })

RE: [R] Object oriented programming resources

2004-08-12 Thread Vadim Ogranovich
The Bioconductor project posts a short tutorial A guide to using S4 Objects under Developer Page frame. I've found it useful. Note that R-s S4-classes approach to OOP is very different from the one of C++ or Java. Yet you will find member vars, they are called slots. -Original Message-

RE: [R] Error messages and C

2004-08-20 Thread Vadim Ogranovich
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ross Boylan Sent: Friday, August 20, 2004 11:35 AM To: r-help Subject: [R] Error messages and C I am calling a C (C++ really) function via the .C interface. Sometimes when things go wrong I want to

RE: [R] More precision problems in testing with Intel compilers

2004-08-20 Thread Vadim Ogranovich
For what it's worth. I had this very problem, i.e. the diff, this morning (I reported it to r-devel). I was using gcc, but because my $CFLAGS env variable was set to some value, the compilation flags were different from the ones presumably used to produce the Rout. Once I unset CFLAGS it worked

[R] how to efficiently bootstrap mgcv::gam

2004-08-26 Thread Vadim Ogranovich
Hi, I repeatedly estimate the same gam model (package mgcv) using different subsets of the data. A naive approach is, of course, to estimate the model from scratch for each of the subsets. However I wonder if there are some computations that can be factored out for the sake of efficiency? To

RE: [R] ANNOUNCE: S-PLUS 7.0

2005-04-11 Thread Vadim Ogranovich
David, From the white paper, the BIG DATA THING looks quite impressive. IMHO, it addresses the biggest limitation the S family has had so far. I could, of course, think of few features that I wish to see there, but the existing functionality looks fairly complete. Congratulations! An R folk Vadim

RE: [R] congratulations to the JGR developers

2005-05-02 Thread Vadim Ogranovich
Well put, Gabor! P.S. Sorry for wasting the bandwidth. Just couldn't resist, so much true it is. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Grothendieck Sent: Monday, May 02, 2005 8:06 AM To: Andy Bunn Cc: R-Help Subject: Re: [R]

[R] distance between distributions

2005-05-05 Thread Vadim Ogranovich
Hi, This is more of a general stat question. I am looking for a easily computable measure of a distance between two empirical distributions. Say I have two samples x and y drawn from X and Y. I want to compute a statistics rho(x,y) which is zero if X = Y and grows as X and Y become less similar.

RE: [R] time zones, daylight saving etc.

2005-05-12 Thread Vadim Ogranovich
Works for me on Linux: Sys.time() [1] 2005-05-12 10:22:31 PDT Sys.putenv(TZ=GMT) Sys.time() [1] 2005-05-12 17:22:37 GMT I extensively use the reset of TZ to parse times. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Grothendieck Sent:

RE: [R] R annoyances

2005-05-19 Thread Vadim Ogranovich
I think the flaw in this reasoning is that programmers are not considered users. IMO, making a better language is beneficial for users. I am now watching how a new colleague of mine, a very good C++ programmer turning into a data miner, is struggling w/ many irregularities of R. -Original

RE: [R] R annoyances

2005-05-19 Thread Vadim Ogranovich
- From: Berton Gunter [mailto:[EMAIL PROTECTED] Sent: Thursday, May 19, 2005 10:55 AM To: Vadim Ogranovich; 'Thomas Lumley'; 'Rod Montgomery' Cc: r-help@stat.math.ethz.ch Subject: RE: [R] R annoyances Vadim et.al: I do not care to comment one way or the other about R's irregularities

[R] Redirect console to file

2005-06-09 Thread Vadim Ogranovich
Hi, Is it possible to redirect the staff that normally goes to the R console window into a file. sink() does this for sdterr and stdout. But I need something that redirects everything that appear in the console window (including the top-level commands). I want to achieve the same effect as

Re: [R] Redirect console to file

2005-06-09 Thread Vadim Ogranovich
Will work, but as you mentioned there ought to be an easier way :-) -Original Message- From: Mike R [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 10:29 PM To: Vadim Ogranovich Subject: Re: [R] Redirect console to file On 6/9/05, Mike R [EMAIL PROTECTED] wrote: On 6/9

RE: [R] read.table: check.names arg - feature request

2003-09-04 Thread Vadim Ogranovich
Ogranovich Cc: R-Help (E-mail) Subject: Re: [R] read.table: check.names arg - feature request Vadim == Vadim Ogranovich [EMAIL PROTECTED] on Wed, 3 Sep 2003 14:29:25 -0700 writes: Vadim Hi, I thought it would be convenient if the Vadim check.names argument to read.table, which

[R] building r-patch

2003-11-05 Thread Vadim Ogranovich
Hi, I am building r-patch from the sources (rsync-ed today). make check produced the following message: running tests of Internet and socket functions expect some differences make[3]: Entering directory `/usr/evahome/vograno/R/tests' running code in 'internet.R' ... OK comparing

RE: [R] building r-patch

2003-11-05 Thread Vadim Ogranovich
- From: Jason Turner [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:50 PM To: [EMAIL PROTECTED] Cc: R-Help Subject: Re: [R] building r-patch Vadim Ogranovich wrote: ... I am building r-patch from the sources (rsync-ed today). make check produced the following message

RE: [R] building r-patch

2003-11-06 Thread Vadim Ogranovich
, November 05, 2003 11:10 PM To: [EMAIL PROTECTED] Cc: R-Help Subject: Re: [R] building r-patch The first is more or less what you should expect. On Wed, 5 Nov 2003, Vadim Ogranovich wrote: Hi, I am building r-patch from the sources (rsync-ed today). make check produced

[R] disabling NA token as na.string in read.table

2002-12-19 Thread Vadim Ogranovich
Dear R-Users, I have a csv file that has NA tokens and these tokens are perfectly good values that need not to be converted to NA by read.table(). I tried to prevent the conversion by specifying the na.strings arg., but this seems to only add to the list of NA strings, not substitute.

[R] how to save envir. when batch is halted

2003-01-06 Thread Vadim Ogranovich
Dear R-users, If for whatever reason a batch execution of my script halts I want R to save my current environment, along with .Traceback var, in the .RData file (in other words I need something like core dump). It seems however that if execution is halted via stop() no .RData file is dumped. So

[R] interaction of options(error=) and try()

2003-01-07 Thread Vadim Ogranovich
Dear R-Users, I am somewhat confused by the interplay between options(error=) and try(). I set my error handler to an expression that dumps the frames and quits. Yet, I thought that this handler would NOT be invoked if an error happens within try(). Apparently it was. Here is the code that I ran

[R] find max of implicit function OR inversion of 2D mappings.

2003-01-31 Thread Vadim Ogranovich
Dear R-Users, I am looking for a help to deal with the following computational problem: I have a mapping f(x, y) - (u, v) of [0,1]*[0,1] - R^2. The mapping is given by tabulating f(x,y) on a uniform 2D grid and is assumed to be interpolatable in between the grid points (the number of points on

[R] commandArgs() prints warnings to STDOUT

2003-02-05 Thread Vadim Ogranovich
Dear R-Users, I was glad to hear that there is an ongoing work to make R more easily runnable as a batch. I'd like to raise two issues in this regards: 1. commandArgs() prints warnings to STDOUT rather than to STDERR, see example below $ cat foo.R argv - commandArgs() $ R --no-save

[R] commandArgs() prints warnings to STDOUT - correction

2003-02-05 Thread Vadim Ogranovich
I realized that it is not commandArgs() rather R itslef that prints the warning to the stdout (which is still not desirable of course): $ R --no-save --no-restore --silent A /dev/null 2 /dev/null ARGUMENT 'A' __ignored__ ===original message below Dear R-Users, I was glad to hear

[R] modeling interaction of continuous vars

2003-02-13 Thread Vadim Ogranovich
Dear R-Users, I wonder what methods are available for modeling interaction of continuous variables. Specifically I am interested in fitting a regression y ~ f(w) * x where y, x are vectors and f(w) is a smooth function of a continuous parameter w (so it is f() that needs to be estimated). I can

[R] using locator with xyplot() result

2003-02-14 Thread Vadim Ogranovich
Dear R-Users, Is there a way to interactively get location of a point on a graph produced by xyplot() of lattice package (similar to what locator() does with a regular plot)? Thanks, Vadim -- DISCLAIMER \ This e-mail, and any attachments thereto,

[R] fitting a curve according to a custom loss function

2003-02-18 Thread Vadim Ogranovich
Dear R-Users, I need to find a smooth function f() and coefficients a_i that give the best fit to y ~ a_0 + a_1*f(x_1) + a_2*f(x_2) Note that it is the same non-linear transformation f() that is applied to both x_1 and x_2. So my first question is how can I do it in R? A more general question

RE: [R] fitting a curve according to a custom loss function

2003-02-19 Thread Vadim Ogranovich
(x_1) + f(x_2) Hope it makes more sense now, Vadim -Original Message- From: Liaw, Andy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 5:33 AM Vadim Ogranovich wrote: Dear R-Users, I need to find a smooth function f() and coefficients a_i that give the best

RE: [R] Some more general questions

2003-03-19 Thread Vadim Ogranovich
The answer to your first question is yes, you can. Under the hood a call summary(data[[5]]) invovles an implicit call to print() of the value returned by summary(). This print produces the output you see. So you need to suppress the default print and call one of your own, e.g. x -

RE: [R] lm with an arbitrary number of terms

2003-04-02 Thread Vadim Ogranovich
I think you can do it like this lm(y~., data=data.frame) # note the dot to the right of ~ -Original Message- From: Richard Nixon [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 8:50 AM To: [EMAIL PROTECTED] Subject: [R] lm with an arbitrary number of terms Hello

[R] books: Programming with Data: A Guide to the S Language vs. S Programming

2004-02-25 Thread Vadim Ogranovich
Hi, Could someone please compare Programming with Data: A Guide to the S Language by J. Chambers and S Programming by W. Venables and B. Ripley? Ideally, I need a guide for writing R OO-style packages that intensively interact with C/C++ libraries. The specific project I have in mind is to

[R] when .Call can safely modify its arguments

2004-02-28 Thread Vadim Ogranovich
Hi, Writing R Extensions Guide clearly states that a C-function interfaced via .Call() should not modify any of its arguments. However I wonder if there are exceptions to this rule, i.e. when .Call can safely modify the arguments. For example when a function creates a list that is then populated

[R] passing a string from .C()

2004-03-01 Thread Vadim Ogranovich
Hi, Could someone please point to an example of passing strings from .C() calls back to R? I want to be able to do something like this: str - .C(return_foo_string, str=character(1))$str void return_foo_string(char ** str) { *str = foo; } The above code has at least two memory

[R] error() and C++ destructors

2004-03-02 Thread Vadim Ogranovich
Hi, I am writing C++ functions that are to be called via .Call() interface. I'd been using error() (from R.h) to return to R if there is an error, but then I realized that this might be not safe as supposedly error() doesn't throw an exception and therefore some destructors do not get called and

RE: [R] error() and C++ destructors

2004-03-09 Thread Vadim Ogranovich
). /Erik Källén -Original Message- From: Vadim Ogranovich [mailto:[EMAIL PROTECTED] Sent: 2 mars 2004 22:00 To: R Help List Subject: [R] error() and C++ destructors Hi, I am writing C++ functions that are to be called via .Call() interface. I'd been using error() (from R.h

[R] how to continue develop package

2004-03-09 Thread Vadim Ogranovich
Hi, I have completed a prototype of a package, say FOO, and now I want to start using it as an ordinary R package, i.e. attach it via library(FOO). On the other hand I will be adding functionality and fixing bugs so the code is going to change a lot. There is a couple of problems that don't know

[R] dyn.unload fails after some C++ code.

2004-03-10 Thread Vadim Ogranovich
Hi, I have a shared library that I can successfully load/unload until I execute some non-trivial code on the library. After that the same dyn.unload() has no effect. Does anyone have an idea what kind of C/C++ code could lock a .so library so that it becomes unloadable? (My code links with a

[R] why-s of method dispatching

2004-03-17 Thread Vadim Ogranovich
Hi, I am having a problem to understand why as.data.frame method doesn't dispatch properly on my class: setClass(Foo, character) [1] Foo as.data.frame(list(foo=new(Foo, .Data=a))) Error in as.data.frame.default(x[[i]], optional = TRUE) : can't coerce Foo into a data.frame I was expecting

RE: [R] why-s of method dispatching

2004-03-18 Thread Vadim Ogranovich
] Sent: Thursday, March 18, 2004 12:24 AM To: Vadim Ogranovich Cc: R Help List Subject: Re: [R] why-s of method dispatching On Wed, 17 Mar 2004, Vadim Ogranovich wrote: I am having a problem to understand why as.data.frame method doesn't dispatch properly on my class: setClass

RE: [R] why-s of method dispatching

2004-03-18 Thread Vadim Ogranovich
, 2004 12:24 AM To: Vadim Ogranovich Cc: R Help List Subject: Re: [R] why-s of method dispatching On Wed, 17 Mar 2004, Vadim Ogranovich wrote: I am having a problem to understand why as.data.frame method doesn't dispatch properly on my class: setClass(Foo, character) [1] Foo

[R] how to customize .First.lib

2004-03-24 Thread Vadim Ogranovich
Hi, I am looking for an elegant solution to the following problem. When I load a package, let's say ROracle, I want some custom actions to be done on top of what package's .First.lib does. In this specific example I want to open a connection to the only database I have around. And I don't see

RE: [R] binding vectors or matrix using their names

2004-03-24 Thread Vadim Ogranovich
?get to convert names into objects -Original Message- From: Stephane DRAY [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 11:41 AM To: [EMAIL PROTECTED] Subject: [R] binding vectors or matrix using their names Hello list, I have two vectors x and x2: x=runif(10)

RE: [R] Doing SQL GROUP BY in R

2004-04-02 Thread Vadim Ogranovich
You might want to look at ?table and ?xtab. See also ?tapply for use of general functions (other than just COUNT) with GROUP BY. HTH, Vadim -Original Message- From: JFRI (Jesper Frickmann) [mailto:[EMAIL PROTECTED] Sent: Friday, April 02, 2004 1:06 PM To: [EMAIL PROTECTED] Subject:

RE: [R] time zones in POSIXt

2004-04-23 Thread Vadim Ogranovich
-Original Message- From: Dirk Eddelbuettel [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 1:52 PM To: Vadim Ogranovich Cc: R-Help Subject: Re: [R] time zones in POSIXt On Fri, Apr 23, 2004 at 11:30:19AM -0700, Vadim Ogranovich wrote: Hi, I have two data sources

[R] recover should send messages to stderr, not stdout

2004-05-11 Thread Vadim Ogranovich
Hi, recover() sends all its messages, which I consider to be error messages, to stdout. I think they more properly belong to stderr. This is an important difference for those of us who use R in batch mode to generate ASCII files. Thanks, Vadim [[alternative HTML version deleted]]

[R] Snow vs Rmpi

2007-02-14 Thread Vadim Ogranovich
Hi, I have few high-level questions about the Snow and Rmpi packages . I understand that Snow uses Rmpi as one of possible transport layers, yet my questions about user experience, not technical details: 1. Does Snow install and work well in Windows? 2. Interruptibility. I understand that

[R] approx with ties = 'ordered'

2007-04-03 Thread Vadim Ogranovich
Hi, I am a bit surprised how approx resolves ties when ties = 'ordered'. In the following two examples I'd expect the first expression to return 1 (not 2). The documentation reads that that 'f=0' is right-continuous and 'f=1' is left-continuous so one would expect the argument to matter when

Re: [R] extracting intercept from ppr fit

2007-04-17 Thread Vadim Ogranovich
Hi, Is there a way, documented or not, to extract the intercept term (the alpha_0 the MASS book) from a ppr() (Projection Persuit Regression) fit? Thanks, Vadim ## Example: n - 1000 data - data.frame(x=rnorm(n), y=rnorm(n)) a - 10 data$z - evalq(a + atan(x + y) + rnorm(n), data)

[R] extracting intercept from ppr fit

2007-04-17 Thread Vadim Ogranovich
Hi, Is there a way, documented or not, to extract the intercept term (the alpha_0 the MASS book) from a ppr() (Projection Persuit Regression) fit? Thanks, Vadim [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing

Re: [R] extracting intercept from ppr fit

2007-04-17 Thread Vadim Ogranovich
Sorry for triple-posting : I seem to have a problem w/ my mail client. Hi, Is there a way, documented or not, to extract the intercept term (the alpha_0 the MASS book) from a ppr() (Projection Persuit Regression) fit? Thanks, Vadim ## Example: n - 1000 data - data.frame(x= rnorm (n),

[R] convert text to exprission good for lm arguments

2007-05-03 Thread Vadim Ogranovich
Hi, I ran into a problem of converting a text representation of an expression into parsed expression to be further evaluated inside lm (). n - 100 data - data.frame(x= rnorm (n), y= rnorm (n)) data. lm - lm (y ~ x, data=data) ## this works update(data. lm , subset=x0) Call: lm

[R] subset arg in (modified) evalq

2007-05-18 Thread Vadim Ogranovich
Hi, When using evalq to evaluate expressions within a say data.frame context I often wish there was a 'subset' argument, much like in lm() or any ather advanced regression model. I would be grateful for a tip how to do this. Here is an illustration of what I want: n - 100 data -

Re: [R] subset arg in (modified) evalq

2007-05-18 Thread Vadim Ogranovich
this to the columns I actually need. Thanks, Vadim - Original Message - From: Gabor Grothendieck [EMAIL PROTECTED] To: Vadim Ogranovich [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Friday, May 18, 2007 9:19:49 AM (GMT-0600) America/Chicago Subject: Re: [R] subset arg

Re: [R] subset arg in (modified) evalq

2007-05-18 Thread Vadim Ogranovich
the overhead is negligible, but sometimes I work with really big data sets. Thanks a lot for your help, Vadim - Original Message - From: Gabor Grothendieck ggrothendieck @ gmail .com To: Vadim Ogranovich vogranovich @ jumptrading .com Cc: r-help @stat.math. ethz .ch Sent: Friday

  1   2   >