G'day Murray,
MJ == Murray Jorgensen [EMAIL PROTECTED] writes:
MJ I found myself wanting to average a vector [vec] within each
MJ level of a factor [Fac], returning a vector of the same length
MJ as vec.
I presume that the vector that you want as result should not just have
the same
On Thu, 13 Apr 2006, roger koenker wrote:
Jeff,
I don't know whether this is likely to be feasible, but if you could
replace calls to lm() with calls to a sparse matrix version of lm()
either slm() in SparseM or something similar in Matrix, then I
would think that you should safe from
On Fri, 14 Apr 2006, Alexander Nervedi wrote:
Hi.
I am having trouble figuring this out. Please help if you know what I am
goffing up on.
rm(list=ls(all=TRUE))
dat-expand.grid(village.code = c(1,2,3), household.id = 1:99, member.id =
1:41, year.code = 75:85, DOI = 1:366)
Error: cannot
Hi
On 13 Apr 2006 at 19:33, Gabor Csardi wrote:
Date sent: Thu, 13 Apr 2006 19:33:30 -0400
From: Gabor Csardi [EMAIL PROTECTED]
To: Barbora Kocúrová [EMAIL PROTECTED]
Copies to: r-help@stat.math.ethz.ch
Subject:Re:
Hi
What about some example data? I presume you could use some
apply, tapply, aggregate or similar function but without knowing what
you **really** want to do and how your previous attempts failed it is
hard to give any definite answer.
e.g.
mydf-data.frame(year=sample(1:4,100,rep=T),
Hi
vec-runif(100)
fac-factor(sample(letters[1:4],100, rep=T))
tap-tapply(vec, fac, mean)
new.vec-tap[fac]
lm1 - lm(vec ~ fac)
all.equal(as.numeric(predict(lm1)),as.numeric(new.vec))
[1] TRUE
HTH
Petr
On 14 Apr 2006 at 17:46, Murray Jorgensen wrote:
Date sent: Fri, 14 Apr 2006
On Thu, 13 Apr 2006, Spencer Graves wrote:
Do you know of a reference that discusses alternative choices for
plotting positions for a normal probability plot? The documentation for
qqnorm says it calls ppoints, which returns qnorm((1:m-a)/(m+1-2*a))
with a = ifelse(n=10, 3/8, 1/2)?
Hello, I have been searching a way to get the resulting optimized
function value of a trained SVM model (svm from the package e1071) but
I have not succeed.
Does anyone knows a way to get that value?
Pau
__
R-help@stat.math.ethz.ch mailing list
Look at ?ave
ave(vec, Fac)
ave(vec, Fac, FUN = mean) # same
ave(vec, Fac, FUN = sd)
On 4/14/06, Murray Jorgensen [EMAIL PROTECTED] wrote:
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I
On Fri, 14 Apr 2006, David Scott wrote:
On Thu, 13 Apr 2006, Spencer Graves wrote:
Do you know of a reference that discusses alternative choices for
plotting positions for a normal probability plot? The documentation for
qqnorm says it calls ppoints, which returns
I downloaded the free CD's and installed Suse 10.0. When I tried to install
the latest RPM for R, the Yast installer complained that two files were
missing. I was told that I can install from the internet, and started the
process, but found I must supply the name of the server and the name of
Here's a small dataset:
type - c('hierarchical','partial','single','complete','single
+hierarchical','single+partial','partial+hierarchical','single+partial
+hierarchical')
freq - c(1455,729,688,65,29,28,16,17)
lodds - log(freq/(3027 - freq))
dotplot(type~lodds)
I would like to have the x-axis
Me, opaque (it is rare that I say too little). Well, your assumption below is
correct. This structure assumes a general covariance matrix for the random
effects. As for the documentation, it is rather sparse at this time. There are
really two places to look. One would be the vignette in the
maybe something like:
dotplot(type ~ lodds, scales = list(x = list(at = -5:0, labels =
round(plogis(-5:0), 3
could do the trick; I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address:
Take a look at the scales argument in dotpolot.
Maybe you need something like:
position-exp(-5:0)/(1+exp(-5:0))
dotplot(type~freq/(3027-freq),
scales=list(x=list(log=T,
at=position, lab=round(position, 3))) )
Stefano
-Messaggio originale-
Da: [EMAIL PROTECTED]
louis homer [EMAIL PROTECTED] writes:
I downloaded the free CD's and installed Suse 10.0. When I tried to install
the latest RPM for R, the Yast installer complained that two files were
missing. I was told that I can install from the internet, and started the
process, but found I must
My question is when the object argument of NexthMethod be used?
In the following example, weather object argument is used will not
affects the result.
###
foo=function(x) {UseMethod(foo)}
foo.cls1=function(x)
{
x=x+1;class(x)-ncls
NextMethod()
}
foo.ncls=function(x)
{
cat(ncls\n)
}
In section 5.5 of the language manual it says:
It is important to realize that the choice of the next method depends on the
current values of .Generic and .Class and not on the object. So changing
the object in a call to NextMethod affects the arguments received by
the next method but does not
I asked:
Here's a small dataset:
type - c('hierarchical','partial','single','complete','single
+hierarchical','single+partial','partial+hierarchical','single
+partial
+hierarchical')
freq - c(1455,729,688,65,29,28,16,17)
lodds - log(freq/(3027 - freq))
dotplot(type~lodds)
I would like
On Fri, 14 Apr 2006, Murray Jorgensen wrote:
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I realised that
lm1 - lm(vec ~ Fac)
fitted(lm1)
did what I want.
But there must be another way
在 06-4-14,Gabor Grothendieck[EMAIL PROTECTED] 写道:
In section 5.5 of the language manual it says:
It is important to realize that the choice of the next method depends on the
current values of .Generic and .Class and not on the object. So changing
the object in a call to NextMethod affects the
Dear R users,
I am using R-function gam(gam) to fit additive models,
more specifically partially linear models.
Say, Y~x1+x2+s(z,df=d).
Is there a way to extract the smoother matrix for the smoothing term
z, or is there a way to extract the overall hat matrix H such that
Y_hat=HY.
Thank you in
Hi,
I would like to count the columns of a data.frame. I know how to count the
rows, but not the columns.
Can someone tell me how to do it?
My best regards,
Giacomo Moro
-
[[alternative HTML version deleted]]
camille wrote:
I am new on Ubuntu. I would like to use R, but I tried Kate and Scite.
The first one keeps trying to use KDE applications,while the other does
not understand the language. I have searched for another editor for
hours, in vain. Which editor should work with Ubuntu?
I use
giacomo moro wrote:
I would like to count the columns of a data.frame. I know how to
count the rows, but not the columns. Can someone tell me how to do
it?
ncol(data.frame)
--
Ramón Casero Cañas
http://www.robots.ox.ac.uk/~rcasero/wiki
http://www.robots.ox.ac.uk/~rcasero/blog
da-data.frame(x=rnorm(10),y=rnorm(10))
ncol(da)
[1] 2
or
dim(da)[2]
[1] 2
2006/4/15, giacomo moro [EMAIL PROTECTED]:
Hi,
I would like to count the columns of a data.frame. I know how to count the
rows, but not the columns.
Can someone tell me how to do it?
My best regards,
?ncol
ncol(data.frame(x=-1, y=0, z=1))
[1] 3
giacomo moro wrote:
Hi,
I would like to count the columns of a data.frame. I know how to count the
rows, but not the columns.
Can someone tell me how to do it?
My best regards,
Giacomo Moro
Hi,
I would like to count the columns of a data.frame. I know
how to count the rows, but not the columns.
...
If you knew how to count the rows, you would have known about nrow which has
the same man page as ncol. Also help.search('number of rows') would have
immediately given you your
Or you can try JGR, http://stats.math.uni-augsburg.de/JGR/.
A nice unified Graphical User Interface for R with integrated editor.
à bientôt...Rod.
On 13/04/06, camille [EMAIL PROTECTED] wrote:
Hello,
I am new on Ubuntu. I would like to use R, but I tried Kate and Scite.
The first one
On Fri, 14 Apr 2006, ronggui wrote:
My question is when the object argument of NexthMethod be used?
Looking at the C code, I don't think it is. But look at do_nextmethod in
src/main/objects.c yourself.
Note that in your examples it would not make any difference as 'x'
is re-evaluated in
That was not a very helpful reply to someone who asked a question. He could
be counting the rows by asking for the length of a full variable in that
data frame, and not be aware of nrow(x). And one could know about nrow()
without knowing about its page in the manual..
There is no need to jump all
Given the following data frame (freq.sp),
str(freq.sp)
`data.frame': 42 obs. of 4 variables:
$ behav : Factor w/ 6 levels approach,bowride,..: 1 1 1 1 1 1 1 2
2 2 ...
$ species: Factor w/ 7 levels COAST_SPOT,EAST_SPINR,..: 1 2 3 4 5 6
7 1 2 3 ...
$ n : int 193 194 563 357 570 369
On 4/14/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Fri, 14 Apr 2006, ronggui wrote:
My question is when the object argument of NexthMethod be used?
Looking at the C code, I don't think it is. But look at do_nextmethod in
src/main/objects.c yourself.
Note that in your examples it
On 4/14/06, Eric Archer [EMAIL PROTECTED] wrote:
Given the following data frame (freq.sp),
str(freq.sp)
`data.frame': 42 obs. of 4 variables:
$ behav : Factor w/ 6 levels approach,bowride,..: 1 1 1 1 1 1 1 2
2 2 ...
$ species: Factor w/ 7 levels COAST_SPOT,EAST_SPINR,..: 1 2 3 4 5 6
Gabor Grothendieck [EMAIL PROTECTED] wrote:
Sasha Pustota [EMAIL PROTECTED] wrote:
ir - rbind(iris3[,,1], iris3[,,2], iris3[,,3])
lir - data.frame(log(ir))
names(lir) - c(a,b,c,d)
I'm trying to understand the meaning of expressions like ~ a+b+c+d,
used with princomp, e.g.
princomp(~
Just use model.frame to examine what is passed:
ir - rbind(iris3[,,1], iris3[,,2], iris3[,,3])
lir - data.frame(log(ir))
names(lir) - c(a,b,c,d)
lir[1,1] - NA
mf - model.frame(~., lir,na.action=na.omit)
head(mf)
ab c d
2 1.589235 1.098612 0.3364722
Deepayan,
Thanks much! That works perfectly!
Cheers,
eric
Deepayan Sarkar wrote:
On 4/14/06, Eric Archer [EMAIL PROTECTED] wrote:
Given the following data frame (freq.sp),
str(freq.sp)
`data.frame': 42 obs. of 4 variables:
$ behav : Factor w/ 6 levels approach,bowride,..: 1 1
(see inline)
Arnaud Ghilain wrote:
Hello,
Can anybody help me understand the difference between the three different
codes
in specifying the slope in the random part of a mixed model using LMER?
Here are the codes:
(age | id)
(1 + age | id)
SG: These to are the same: For each
Ok, that was just my wishful thinking.
Is there a way to plot repeated labels that identify groups, e.g.
factor(c(rep(s,50),rep(c,50),rep(v,50)))
instead of 1--150 row indices, using something like
biplot(princomp(lir)) ?
Gabor Grothendieck [EMAIL PROTECTED] wrote:
Just use model.frame to
I've looked in the online documentation for this, but have been unable to
find an answer. I can name variables dynamically, but I cannot call them
dynamically. Either a direct answer or a reference to an online resource
that has the answer would be great.
I'm trying to write a script that imports
1. The FAQ entry advise you to use a list, instead of using assign() in a
loop. Have you considered that?
2. See ?get.
Andy
From: [EMAIL PROTECTED]
I've looked in the online documentation for this, but have
been unable to find an answer. I can name variables
dynamically, but I cannot
Hello all. I could really use some help in writing a new glm link function
in order to run an analysis of daily nest survival rates. I've struggled
with this for weeks now, but I'm afraid I can't figure out even how to get
started (fairly new at R, complete beginner in writing functions in R!).
One of the components of the returned princomp() objects can be $scores, the
matrix of scores. You can plot these as usual using any characters you like
via the 'pch' parameter of plot:
e.g.
## groups is a factor giving the groups for each data value.Assuming three
groups
Berton Gunter [EMAIL PROTECTED] wrote:
plot(myscores[,1:2],pch=c('s','c','v')[groups])
Thanks, this works. How to understand the result of
the expression
c(1,2,'3)[groups]
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
where
groups - factor(c(rep(X,5), rep(Y,5), rep(Z,5)))
?
Sorry if it's
Sasha Pustota [EMAIL PROTECTED] wrote:
Berton Gunter [EMAIL PROTECTED] wrote:
plot(myscores[,1:2],pch=c('s','c','v')[groups])
Thanks, this works. How to understand the result of
the expression
c(1,2,'3)[groups]
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
where
groups -
does this explain it?
groups - factor(c(rep(Z,5),rep(X,5),rep(Y,5)))
groups
[1] Z Z Z Z Z X X X X X Y Y Y Y Y
Levels: X Y Z
as.integer(groups)
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
c(1,2,3)[groups]
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
On 4/14/06, Sasha Pustota [EMAIL PROTECTED] wrote:
Sasha
jim holtman [EMAIL PROTECTED] wrote:
does this explain it?
groups - factor(c(rep(Z,5),rep(X,5),rep(Y,5)))
groups
[1] Z Z Z Z Z X X X X X Y Y Y Y Y
Levels: X Y Z
as.integer(groups)
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
c(1,2,3)[groups]
[1] 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2
I did
dear group,
i have a sample matrix
name v1 v2 v3 v4
cat 1011 12 15
dog 3 12 10 14
cat 9 12 12 15
cat 5 12 10 11
dog 12113 123 31
...
since cat is repeated 3 times, I want a mean value for
it. Like wise for every element of the name
48 matches
Mail list logo