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 -
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
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
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
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)
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
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),
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
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
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
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
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
-
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
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:
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.
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]
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
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
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.
)
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
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
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
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
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
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
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
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,
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
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 (=
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
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]]
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
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
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-
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
-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
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
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
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
-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
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
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-
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)
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))
})
: 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'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
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
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 -
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
-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
,
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
() 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
(), 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
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
:[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
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
)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
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
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
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
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
-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
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
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]]
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
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
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)
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)
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
, 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
-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
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:
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
?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)
]
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
, 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
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
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
).
/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
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
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
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
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
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
, 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
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
-
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
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
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
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 -
(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
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
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,
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
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
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
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
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
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
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.
100 matches
Mail list logo