In addition to the previous replies, try this
x <- as.numeric(strsplit("1011011", NULL)[[1]])
g <- rep(1:3, each=9) # set numbering
rbind(x, g) # to check
y <- unlist( tapply(x, g, cummin) )
> y
11 12 13 14 15 16 17 18 19 21 22 23
Dear all,
Can anyone please help me about any of the following questions:
1. How can i find "factorial" of any number in R? I tried
> prod(170:1) # to find factorial of 170 or 170!
Is it the only procedure - or R has any better process / operational
c
I am having trouble converting the output from Sweave
into a valid PDF file.
I have created a simple .Rnw file which will become a
full vignette at some point, but during the
intermediate testing, I got errors from texi2dvi.
This is what I have done.
0) Using a Windows Xp system
1) Created a file
A hemisphere is relatively easy; try the following:
x <- seq(-1, 1, length=21)
Z <- outer(x, x, function(x, y)sqrt(1-x^2-y^2))
persp(x=x, y=x, z=Z)
A contour plot is also relatively easy:
image(x=x, y=x, z=Z)
contour(x=x, y=x, z=Z, add=T)
However, if you
In a message dated 12/25/2003 3:00:34 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:
>You are trying to fit a loess curve to just five points: that is not
>sensible (and interpolates in S-PLUS, so I don't think it `works' there
>either).
>
Thanks for the quick reply.
>Loess in R is not
Hi,
I'm new to R (and math ;) Would somebody please be so kind as to direct me
in plotting a 3D sphere?
I tried something in the lines of:
y <- x <- seq(-pi, pi, length=pi*10)
f <- function(x,y)
{
z <- sqrt(pi - x^2 - y^2)
#z[is.na(z)] <- 0
z
}
z <- outer(x, y, f)
pe
You are trying to fit a loess curve to just five points: that is not
sensible (and interpolates in S-PLUS, so I don't think it `works' there
either).
Loess in R is not the same as loess in S-PLUS. (The latter is
proprietary, and loess in R was implemented as a wrapper for the released
C/Fortran
Hi all,
I am just learning R and I am trying to work through the book "Applied
Longitudinal Data Analysis" by Singer & Willett. I have some code for this book
that supposedly works in S-Plus (I don't have S-Plus so I can't verify that) and
I am trying to run the examples in R. Most of the exa
Dear All,
Thanks to all that took the time to respond to my questions (included
at the bottom). Martin Maechler was nice enough to give me a detailed
explanation which he suggested i forward.
The confusion arose because
if(exists("x")) plot(x,x)
else{ plot(1,1,type="n");text(1,1,"data not ava
On Thu, 25 Dec 2003 11:53:40 +0900
Masahiko AIDA <[EMAIL PROTECTED]> wrote:
> Is there any faster implementation of logistic regression
> than glm function in base package in R?
>
> I am working on simulation study and discovered glm fitting part is the
> bottle neck of my program.
>
> -Masahiko
Dear David,
I encountered your query from last September on the internet, and I need the very same
thing myself, so I was wondering if you have already found a code that handles this
problem. To refresh your memory I attach your query.
Thanks in advance,
Gady Zohar.
>Hi
>
>Does anyone know
On Thu, 25 Dec 2003, Masahiko AIDA wrote:
> Is there any faster implementation of logistic regression
> than glm function in base package in R?
>
> I am working on simulation study and discovered glm fitting part is the
> bottle neck of my program.
Have you tried profiling (see Writing R Extensi
12 matches
Mail list logo