Ben Bolker [EMAIL PROTECTED] wrote:
Yes, although this becomes tedious if (e.g.) you have a function that
calls two different functions, each of which has many arguments (e.g.
plot() and barplot(); then you have to set up a whole lot of arguments
that default
On Wed, 2003-09-17 at 17:29, Deepayan Sarkar wrote:
On Tuesday 16 September 2003 23:51, Jason Turner wrote:
... the lack of POSIXct support in the
lattice graphics axes has often caused me to think up new ways around
the plot. Unless I'm missing an obvious way to apply that...
Actually,
On Tue, 16 Sep 2003, Deepayan Sarkar wrote:
Is the date class standard enough to warrant including a check for it in
lattice ?
I don't think so. The POSIX*t classes in R are the most standard,
followed by the chron package and only then the date package.
--
Brian D. Ripley,
On Tue, 16 Sep 2003, Peter Whiting wrote:
On Tue, Sep 16, 2003 at 04:17:59PM -0400, Thomas W Blackwell wrote:
Peter -
Your subsequent email seems just right. You have to determine
ahead of time which rows can be estimated.
It seems that predict removes rows with insufficient
Spencer == Spencer Graves [EMAIL PROTECTED]
on Tue, 16 Sep 2003 19:54:22 -0700 writes:
Spencer Consider
Spencer Q - function(x)q(no)
Spencer With R 1.7.1 under Windows, Q() caused R to close
Spencer without asking for confirmation. This does not
Spencer solve the
Rajarshi Guha wrote:
Hi,
I'm working with the ks.test() function and I have also implemented
the test using Conover as the reference. My D value matches that
produced by R. However to calculate the p value I am using the code
described in Numerical Recipes in C++ (2nd Ed.) pg 631.
The p value
BDR == Prof Brian Ripley [EMAIL PROTECTED]
on Wed, 17 Sep 2003 06:58:48 +0100 (BST) writes:
BDR On Tue, 16 Sep 2003, Deepayan Sarkar wrote:
Is the date class standard enough to warrant including a
check for it in lattice ?
BDR I don't think so. The POSIX*t classes in R
Martin Maechler wrote:
Spencer == Spencer Graves [EMAIL PROTECTED]
on Tue, 16 Sep 2003 19:54:22 -0700 writes:
Spencer Consider
Spencer Q - function(x)q(no)
Spencer With R 1.7.1 under Windows, Q() caused R to close
Spencer without asking for confirmation. This does not
MM == Martin Maechler [EMAIL PROTECTED]
on Wed, 17 Sep 2003 08:36:19 +0200 writes:
Spencer == Spencer Graves [EMAIL PROTECTED]
on Tue, 16 Sep 2003 19:54:22 -0700 writes:
Spencer Consider
Spencer Q - function(x)q(no)
Spencer With R 1.7.1 under Windows, Q() caused R to
On Wednesday 17 September 2003 01:36, Martin Maechler wrote:
How can you write (quite short!) R code such that
typing
Q
-- without any () -- will quit R (without asking about saving).
[But you shouldn't really keep that code active in your standard R session
because it would be
First, 42 characters...
Q=no;class(Q)=Q;print.no=function(x)q(Q)
Interestingly, the following works too (41 chars)
Q=;class(Q)=Q;print.=function(x)q(no)
Is it legal though to have empty class names?
And finally, the beautiful one with 28 characters
Q=no;class(Q)=Q;print.no=q
Have nice day!
Deepayan Sarkar wrote:
Barely, 46 removing all spaces:
print.q-function(x)q(no);Q-1;class(Q)-q
We can also replace - by = in recent (and _ in older) versions of R to
decrease this further.
This is 'R-golf'. Perl golf competitions are quite common and usually
result in seriously obfuscated
Sorry for bugging you AGAIN, but I went to get a coffee and I realized
you can get down to 26 characters:
class(Q)=Q=no;print.no=q
That is a good question to put up on an R/parsing/S3/UseMethod quiz,
ehe?!
Henrik
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Hi,
suppose i have a gam object
gamobject- gam( Y~ s(X1)+s(X2)+ X3)
I would like to extract the predicted partial effect of X3 but selecting
it by its name, as it's to be included in a function and i don't always
know the exact position of X3.
something like
On Wed, 17 Sep 2003, Martin Maechler wrote:
BDR == Prof Brian Ripley [EMAIL PROTECTED]
on Wed, 17 Sep 2003 06:58:48 +0100 (BST) writes:
BDR On Tue, 16 Sep 2003, Deepayan Sarkar wrote:
Is the date class standard enough to warrant including a
check for it in lattice ?
I am using R 1.7.1 on Windows, running a program on a daily basis which produces a
vector of text results, where the length of the vector may be different each day.
While I can display this vector in the R console using a cat instruction, I am
presently unable to either print it out on a
Hi,
I am looking for a time series function called arma.roots and I can't find it. This
function compute the roots of a MA or AR defining polynomial and display graphically.
Thanks
Usman
-
Want to chat instantly with your online friends? Get the FREE
Martin Maechler [EMAIL PROTECTED] wrote:
Could chron and date users be heard about what
functionality they are missing in POSIX.t ?
As a chron user, I suppose none. But I find chron more
friendly and it saves some typing.
In my opinion, as.POSIXct and most related functions have
rather
On Wed, 17 Sep 2003, Simon Fear wrote:
There have been various elegant solutions to test for the presence
of a particular named parameter within a ... argument, such as
if (!is.null(list(...)$ylim))
if (ylim %in% names(list(...)))
I think I'd have to comment these lines pretty clearly if
Hi guys,
After all the discussion yesterday about persp and color, I decided to
have a more closer look at demo(persp), and decided to write a function to
generate 'topo-like' colours to plot perspectives (Thanks a lot to Uwe
Ligges for his enlightning comments regarding the code in the demo).
Well, I started playing with fractals in R, and wrote a function to
generate de Mandelbrot set, which might
be of interest to some people
###
# Mandelbrot set
how about: ?write
something like:
your.text - c(date(), insert name of your R object, end )
write(your.text, your-text.txt, append=TRUE)
date() and end should help you to separate your daily changing
character vectors.
HTH,
Bernhard
I am using R 1.7.1 on Windows, running a
Thanks for the insight.
-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
snip
dots - list(...)
haveYlim - ylim %in% names(dots)
is the sort of thing we still understand 5 years later.
I didn't say understand, I said easily follow. Obviously how
easily is
If I display a line chart, with peaks and valleys, and visualize rain
falling on a mountain range, filling in all the valleys. This produces a
series of lakes between peaks. In case the highest peak s not at the right
most edge, erect a dam on the right to back up the water to the highest
peak,
in the paper Avoiding the effects of concurvity in GAM's .. of
Figueiras et al. (2003) it is mentioned that in GLM collinearity is taken
into account in the calc of se but not in GAM (- results in confidence
interval too narrow, p-value understated, GAM S-Plus version). I haven't
found
Hello MZodet,
Wednesday, September 17, 2003, 2:14:12 PM, you wrote:
Mag How do I rotate 3D plots/surfaces generated by either cloud or wireframe?
wireframe has the screen parameter which reads a list to rotate ...
something in this kind:
wireframe(object, screen = list( x = 5, y = 5 , z=
Hi,
I'm building R 1.7.1 in a SuSE 8.2 box with the updated compiler from
SuSE (gcc 3.1.1-16) and I'm getting this error:
making dataentry.d from dataentry.c
In file included from /usr/X11R6/include/X11/keysym.h:73,
from dataentry.c:36:
ps. mgcv 0.9 out now! (changes list linked to my www page)
Hello,
I tried to update mgcv but it doesn't work
update.packages()
mgcv :
Version 0.8-9 in /usr/lib/R/library
Version 0.9-2 on CRAN
Update (y/N)? y
trying URL `http://cran.r-project.org/src/contrib/mgcv_0.9-2
.tar.gz'
Content type
[EMAIL PROTECTED] wrote:
How do I rotate 3D plots/surfaces generated by either cloud or wireframe?
wireframe - I think you have to set the screen parameter, see the
example from ?wireframe, it seems to me you can rotate the surface as
you like.
I believe it's the same thing for cloud, but I did
hello,
i have some problems with mstree!
there are no similar function in R like in S-Plus!
Is there somebody who has a code in R
Thanks
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Starting in November, a short series of R courses will take place
at the University of Hanover. The topics will include
* Introduction to Data Analysis with R
(T. Hothorn, U. Ligges, A. Zeileis)
* Programming with R
(K. Hornik, F. Leisch)
* Mixed Models in S
(J. Pinheiro)
More details
Hello,
I have used the univariate Ripley K function in R, but does anyone know if
there is a bivariate function built in? I have two species that I am dealing
with.
Also, how might I add error bars into the graphs (univariate and/or
bivariate)?
Thank you,
Karin Leiderman
[EMAIL PROTECTED]
Perhaps MZodet wants the interactive, mouse controlled rotation
capability offered by ggobi www.ggobi.org ? Designed for linux
but advertises better portability to Microsoft Windows.
I have no experience myself either installing or using this.
- tom blackwell - u michigan medical school -
/usr/bin/ld: cannot find -lf77blas
- this is the problem, the linker can't find the basic linear algebra
system library on your machine (I'm surprised R can be built without
this). I think you may need to install the atlas package, but am not sure:
hopefully someone else will know...
Simon
Thank you! Using control = gnlsControl(...) has made
a difference in several of my model calls [no other change
needed, except that gnlsControl(...) does not accept
pnlsTol or pnlsMaxIter options]. For several other model
calls, fiddling with the intial parameter estimates helped.
Best,
david
Dear all, there is an R function that return all possible samples of size n,
with replacement, from a vector of length N ?
Best regards
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Thomas W Blackwell wrote:
Perhaps MZodet wants the interactive, mouse controlled rotation
capability offered by ggobi www.ggobi.org ? Designed for linux
but advertises better portability to Microsoft Windows.
I have no experience myself either installing or using this.
In that case we might want
Hi there,
I am using the ts class of the R package. I have a data file
containing a time series of 1152 entries. It is actually 4 days data
cascaded together where the time interval of data collected is 5 minutes.
Thus, I have 288 values per day.
When I am trying to fit this data using a
I have a stem map of trees that are different from CSR at distances of 10-15 meters on
a hectare plot. There are about 100 stems per ha.
I want to generate a point pattern that replicates this for a model. So, about 100
trees in a 100 x 100 space that are clustered at distances from 10-15
Hello,
We had all kinds of trouble of compiling/running R correctly on IBM p690.
Anybody have successfully experience and would like to share with us?
Please reply me personally (see my email address below), since I am not
subscribing this mailing list.
Thanks a lot!
Simon
At Wednesday 11:19 AM 9/17/2003 +0100, Simon Fear wrote:
There have been various elegant solutions to test for the presence
of a particular named parameter within a ... argument, such as
if (!is.null(list(...)$ylim))
if (ylim %in% names(list(...)))
I think I'd have to comment these lines pretty
I am not sure if this is the easiest way, but you can do something like
this:
library(gregmisc)
combinations(N, n, x, repeats=TRUE)
where x is an atomic vector of size N. The only restriction is that the x
vector has to have N unique elements. The combinations function will
return a matrix
Tony, I don't understand what you mean. Could you give
an example?
-Original Message-
From: Tony Plate [mailto:[EMAIL PROTECTED]
... I'm not saying never write functions that use ...,
I'm just saying never write functions that depend on a particular
argument being passed via
Hello,
Do you know if it's possible to create a plot as in matlab with the
options hold on and hold off?
For example I want to plot in the same figure the theoric cdf of the
normal distribution and the empiric cdf from the raw data.
Thank you,
Josep.
Look at the argument new under ?par.
Probably better way is to use the following sequence:
plot(...) # whatever your first plot is.
lines(...) # add line to the existing plot.
points(...) # add points to the existing plot.
There are many other functions that add to the existing plot.
HTH,
Have you considered enclosing the very long string in parentheses?
Then R will know that it is not syntactically correct until it reaches
the end. To avoid that kind of thing, I routinely include ( just to
the right of - in virtually any statement that might otherwise get
split onto two
Simon, I agree, for some (maybe most) arguments it is good to know what
defaults are being used. But there are some for which I really don't want
to know. An example of the latter is arguments that control interaction
with a database. Suppose I have a low-level interaction function that
It works for me. The last link command is:
gcc -shared -L/usr/local/lib -o mgcv.so gcv.o magic.o mat.o matrix.o
mgcv.o qp.o tprs.o -llapack -lblas ...
I have NOT got libf77blas in my linux system either but I have got
libblas.a and libblas.so and
the linker find the right library libblas to link.
Another possibility (to plug my own stuff) is to use the LG3d package
in my bbmisc package (http://www.zoo.ufl.edu/bolker/R/src for source,
http://www.zoo.ufl.edu/bolker/R/windows/ for precompiled windows package),
which uses the Live3D java applet to display (rotatable etc.) graphics in
a
Hi,
I have a data.frame that has 3 columns (ID, Test, Result) and looks like this
1, Test1, 120
1, Test2, 34
2, Test1, 132
2, Test2, 28
etc
I would like to turn it around so that it looks like this
1, 120, 34
2, 132, 28
etc
I have played around some with t and reshape, but with no
Roger D. Peng wrote:
I believe the `splancs' package from CRAN has a bivariate K function.
For error bars you'll probably have to use Monte Carlo methods.
`splancs' has some tools for that.
See also 'spatstat' for Kmulti and Kcross.
Since R doesn't have a univariate K-function in the base
Here is a brute force way:
mm - NULL
for(i in unique(ID)){
zz - data.frame[ID==i, 3]
mm - rbind(mm, c(i, zz))
}
It will work as long as you have the same number of tests for each ID. If
not, you would need to pad shorter zz vectors with NAs.
Cheers,
Andy
Hi All,
I have a function, f(x,y)
I have a matrix of data, m, with the 1st column is x and the 2nd column is y
What's the best way to get f(x,y) for each row of the matrix?
I tried
result-f(m[,1],m[,2]) but it doesn't work.
Thanks!
Bing
-
1060 Commerce Park
Isn't this what you want?
x - data.frame(id=rep(1:2, each=2), test = rep(c(test1,test2), 2),
+ score = c(120, 34, 132, 28))
x
id test score
1 1 test1 120
2 1 test234
3 2 test1 132
4 2 test228
reshape(x, timevar=test, direction=wide)
id score.test1
I'm not sure if that's the best way
apply(MAT, 1, FUN)
-Ursprngliche Nachricht-
Von: Bing Zhang [mailto:[EMAIL PROTECTED]
Gesendet: Mi 17.09.2003 20:02
An: r-help
Cc:
Betreff: [R] using matrix data for function
Dear collegues,
How can I get the name of a variable (and not the variable) within a
function ?
For instance, in the following function, I'd like to create a variable
in the dataframe df with the same name to the variable passed in var:
prova - function( var )
{
df -
Thanks. How about I have a third parameter for the function, which is a fixed
object? i.e. the function is f(o,x,y)
Bing
= Original Message From [EMAIL PROTECTED] =
Assuming that f(x,y) is not vectorize, try
apply(your.matrix, 1, function(x) f(x[1], x[2]))
as in:
x.1 -
Don't think this is best, but here's one way:
mat - matrix(1:12, 6)
mat
[,1] [,2]
[1,]17
[2,]28
[3,]39
[4,]4 10
[5,]5 11
[6,]6 12
f - function(x, y) x + y
apply(mat, 1, function(x) do.call(f, as.list(x)))
[1] 8 10 12 14 16 18
Note that
Well you don't know that the actual argument to a function is a name -
it could be a more complex expression. In any case, you can get the expression
that was the actual argument with the substitute function, then you
need to deparse it. Your function could be written
prova - function( var )
+
Greetings,
Does anyone know of an R code for classification and regression tree
analysis (CART)?
Thank you
Ron
Ron Thornton BVSc, PhD, MACVSc (pathology, epidemiology)
Programme Co-ordinator, Active Surveillance
Animal Biosecurity
MAF Biosecurity Authority
P O Box 2526
Wellington, New Zealand
Ron,
Does anyone know of an R code for classification and regression tree
analysis (CART)?
If I got you right, you need a tree package. It implemets the CART method.
If you go further, you will like randomForest package.
Regards,
Vladimir
__
[EMAIL
The problem with POSIXt is that you must consider timezones
and daylight vs. standard time issues even if you don't want
to. This violates modularity (viz. your routines becomes coupled
to unrelated information) and leads to subtle errors where different
routines are assuming different time
library(tree)
?tree
should work. If you don't have the tree library,
you can download it off of CRAN at
http://cran.r-project.org/bin/windows/contrib
if you're using Windows, or go to
http://cran.r-project.org/src/contrib/PACKAGES.html
for the source code directly as gzipped .tar files.
Or, I think, the rpart package.
On Thu, 18 Sep 2003, Vladimir N. Kutinsky wrote:
Date: Thu, 18 Sep 2003 00:18:25 +0400
From: Vladimir N. Kutinsky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [R] CART analysis
Ron,
Does anyone know of an R code for classification and regression
On Thu, 2003-09-18 at 06:02, Bing Zhang wrote:
Hi All,
I have a function, f(x,y)
I have a matrix of data, m, with the 1st column is x and the 2nd column is y
What's the best way to get f(x,y) for each row of the matrix?
I tried
result-f(m[,1],m[,2]) but it doesn't work.
That is the best
On Thu, 2003-09-18 at 06:41, Bing Zhang wrote:
Thanks. How about I have a third parameter for the function, which is a fixed
object? i.e. the function is f(o,x,y)
1) My earlier reply had a typo. Should've been apply(m,1,f).
2) Luckily, the answer to this question, and any more you're likely
On Wed, 2003-09-17 at 19:03, Gabor Grothendieck wrote:
The problem with POSIXt is that you must consider timezones
and daylight vs. standard time issues even if you don't want
to.
...
I had previously suggested that we either put chron into the base
or create a new timezone-less version
The problem with using a convention is that you can't be guaranteed
that all the routines you use also use that same convention. You
still have to understand how each of the routines you use handle time
zones and you are dragged into thinking about an irrelevant piece of
information violating
Thanks. I didn't try the Borland utility but your response reminded me of a
way to view the DLL info in Windows. Right click a DLL and then quick
view and Windows outputs some file information, including the Export table
which lists the names of the symbols in the DLL. The name of the add
This is not a strictly R question, but I am trying to build the XML
package on MacOS X and have not been successful. I have tried using
expat, libxml, and libxml2 without success in building. Has someone
successfully done this that could enlighten me with the process
(especially as it relates to
On 17-Sep-03 lamack lamack wrote:
Dear all, there is an R function that return all possible samples of
size n,
with replacement, from a vector of length N ?
Without delving into R to see if such a thing exists already, I can
suggest the following (based on an algorithm to be found in
Hi,
Another possibility is to use the combinations function in the gregmisc
package, which has an option repeats.allowed.
Sorry for not including the original post, but I had deleted it from my
mailbox earlier in the day.
HTH,
Dennis
__
[EMAIL
When assigning a dataframe to a subset of a matrix I got a very odd
result. Am I missing something, or is this a bug? Details are below.
Also, if m is defined outside of the current function, is
m[...] - foo
necessary to update it, or does regular replacement
m[] - foo
work (that is, does
A subset of a data.frame is still a data.frame. A data.frame is
actually a list with additional attributes. As far as I know, your
solution, as.matrix, is an appropriate tool to convert a data.frame to
a matrix. Caution may be appropropriate, however, because if the
data.frame includes
Can anyone explain the following? [R 1.6.0 Windows XP, yes I will
upgrade soon.]
Murray
sort(IATmedian)[0:50]==0
[1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
FALSE
[13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[25] FALSE FALSE FALSE
Your IATmedian has some NAs (which are removed by sort) ?
On Thu, 18 Sep 2003, Murray Jorgensen wrote:
Can anyone explain the following? [R 1.6.0 Windows XP, yes I will
upgrade soon.]
Murray
sort(IATmedian)[0:50]==0
[1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Blush! Not too hard to explain at all!
Deepayan Sarkar wrote:
Your IATmedian has some NAs (which are removed by sort) ?
On Thu, 18 Sep 2003, Murray Jorgensen wrote:
Can anyone explain the following? [R 1.6.0 Windows XP, yes I will
upgrade soon.]
Murray
sort(IATmedian)[0:50]==0
[1] TRUE
[Due to problems with my mail client, this message may
eventually reach the list twice. Sorry about that.]
On Wednesday 17 September 2003 08:51, David James wrote:
Prof Brian Ripley wrote:
On Tue, 16 Sep 2003, Deepayan Sarkar wrote:
Is the date class standard enough to warrant including a
Hello.
I am using R 1.7.1 on Mac OSX10.2.6 and XDarwin86 4.3.
I made barplot graph by barplot2.
I can get good graph on x11() device.
But when change the device to potscript(), the graph changed to
incomplete.
For example, absence of label or err bar or ...
I would like to print out this graph.
On Wed, 2003-09-17 at 21:56, Atsuya Fujito wrote:
Hello.
I am using R 1.7.1 on Mac OSX10.2.6 and XDarwin86 4.3.
I made barplot graph by barplot2.
I can get good graph on x11() device.
But when change the device to potscript(), the graph changed to
incomplete.
For example, absence of
80 matches
Mail list logo