Hi,
You need an additional id column in your data frame, which represents the
replication number within each subject (the "1", "2" in the column headings
after reshaping in what you showed).
test <- data.frame(subject=c(1,1,2,2,3,3), coder=c(1,2,3,2,2,1),
score=c(20,30,10,5,15,NA), time=c(5,4,
A parenthesis is missing. You can figure that out easily watching the first
error.
text(0.5,0.5, text = paste(letters[i], "+", numbers[j],"=", letters [i+j+k]))
Xavier
- Mail Original -
De: "Antje##"
À: r-help@r-project.org
Envoyé: Vendredi 9 Octobre 2009 17h36:34 GMT +01:00 Amsterdam
Whatever your final choice is, I think you should really try to use the
distribution's package management system. I don't use the distributions you
cited so I can't give you precise hints, but I'm sure you can easily find
tutorials on how to install/remove software. It will make things a lot eas
Apologies for the misunderstanding. I can come up with a solution that might
suit your needs:
library(plyr)
out <- ddply(test, .(nr), function(x) data.frame(date=x$date,
index=rank(-as.integer(x$date
out[is.na(out$nr) | is.na(out$date), "index"] <- NA
Xavier
- Mail Original -
De: "
Is this what you want?
test[order(test$nr, -as.integer(test$date)),]
Xavier
- Mail Original -
De: "Stefan Uhmann"
À: r-help@r-project.org
Envoyé: Mardi 29 Septembre 2009 11h27:20 GMT +01:00 Amsterdam / Berlin / Berne
/ Rome / Stockholm / Vienne
Objet: [R] sort dates within a factor
De
Or with plyr there's a more flexible approach:
res.aov <- dlply(warpbreaks, .(tension), function(x) aov(breaks ~ wool, data=x))
# aov results are stored in a list, you can directly extract what you want with
l*ply
l_ply(res.aov, function(x) print(summary(x)))
ldply(res.aov, function(x) data.fram
Hi,
You can't use cast directly on your dataframe. You need to use the melt
function before, and use cast on its result.
Very good examples are provided in the doc of the package:
http://had.co.nz/reshape/
Also, you need to provide one formula (not several as in your code), something
like:
Ori
Hi,
Apart from everything that's been answered already, it seems in your first mail
that you were confusing merge and rbind.
rbind is to append rows to a data set.
merge performs joints, like in a relational database
- Mail Original -
De: "Jarrett Byrnes"
À: "R help"
Envoyé: Mercredi
Hi,
I don't think grep can handle a vector of patterns.
> grep( c("foo1", "foo2"), c("fffoo5", "fffoo6", "fffoo2", "fffoo1"))
[1] 4
This call is equivalent to:
grep( "foo1", c("fffoo5", "fffoo6", "fffoo2", "fffoo1") )
Maybe you could use the plyr package. I am only speculating, but something l
Try this:
bj2=bjerrdata$tyerr[ (bjyearnum[2]+1):bjyearnum[3] ]
I think it's more like what you meant to do. I believe what you wrote actually
did: bjyearnum[2]+(1:bjyearnum[3])
So the problem was with arithmetic priorities, in my opinion (":" having a
higher priority than "+").
Check this:
> (1
Hi,
It sounds like the first column that is "added" is actually the row names.
That's why a previous answer pointed this argumented. Default for write.csv is
to write the row names along with the data. So, this should work:
write.csv2(exampleDataframe,file="exampleDataframe.csv", row.names=FALSE
Hi,
It seems like your multivariate regression works for groups A and B. For group
C, values are calculated using an interaction between x1 and x2. Try to include
it in the regression model to find the right coeffs:
y ~ grp:x1:x2 + grp:x1 + grp:x2 + grp - 1
It works for me. Notice in summary()
Hi,
The way you do it actually renames the factors one after each other (it
replaces the values in the data frame, which is not what you want).
Have a look at this code:
test <- data.frame(id=c(1,2,3), fac=c("lv1", "lv2", "lv3") )
levels(test$fac)
test$fac2 <- factor(test$fac, levels=c("lv3", "l
Hi all,
I'm doing nonlinear regressions on data with several factors. I want to fit say
a logistic curve with different parameter values for each factor level. So I'm
doing something like:
tmp <- by( myData, list(myFactor1, myFactor2), function(x) nls(...) )
It works fine. However, I could not
, I
think).
Xavier
hadley wickham a écrit :
More generally, how do I control the size of fonts used in legends
and axis labels?
There is no general way (yet) - it is on my customisation to do list,
which I hope to make progress on over summer.
Hadley
--
Xavier Chardon
Thésard I
space at both
sides.
Thanks for your help!
Mikhail
====
Mikhail Spivakov, PhD
Postdoctoral Fellow
EMBL/EBI
UK & Germany
--
Xavier Chardon
Thésard Institut de l'élevage / INRA
Projet ACTA "modélisation environnementale des systèmes bovins et porcins"
[EMAIL PROTECTED]
[EMAIL
h and I
can't use scale_fill_identity
Date: Tue, 29 Apr 2008 17:29:13 +0200
De: Xavier Chardon <[EMAIL PROTECTED]>
Répondre à :: [EMAIL PROTECTED]
Pour :: Mikhail Spivakov <[EMAIL PROTECTED]>
Références: <[EMAIL PROTECTED]>
Hi,
I had a similar
e' in some way, for example as
being in device units (pixels) rather than in points.
On Tue, 29 Apr 2008, Xavier Chardon wrote:
Hi all,
I prepared a few charts with ggplot2, and was happy with the results
as displayed on screen.
I tried to draw them with a PNG driver instead. But
Hi all,
I prepared a few charts with ggplot2, and was happy with the results as
displayed on screen.
I tried to draw them with a PNG driver instead. But I ran into several
problems while trying to increase the resolution of the picture.
Mainly, when I increased the picture size (e.g png(width
19 matches
Mail list logo