x , ... ) }
myfun(m1, main=paste("n = ",ns) )
ns is not found
So, basically, how do I assign an object inside a function that I can
then access in the dots when executing the function?
Many thanks
Marianne
--
Marianne Promberger PhD, King'
variable:
dat1$condnew <- paste(dat1$cond1,dat1$cond2,sep="")
although I am sure there are more elegant ways, and especially, I am
stumped how to fill in the cells of the table.
Thanks,
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version
Hi Joel,
> I got an barplot, and I would like to have the exact number of the bars just
> above the bars anyone know how to do this?
Google "r number above bars barplot" for threads on this list how to
do it and why you might not want to.
?text
Marianne
--
Marianne Prombe
name id memory storage newcol
1 mohan 1 100.2 1.1 1
2 ram 1 200.0 100.0 1
3 kumar 1 400.050.0 1
4 xxx 1 100.040.0 1
5 aaa 1 800.045.0 1
6 mount 1 200.080.0 1
main[,c(1,5,2,3,4)] # order columns by indexing
--
Marianne Pro
1.1 112 0.01
4 mount 1 200.080.0 0 0 0.00
5 ram 1 200.0 100.0 0 0 0.00
6 xxx 1 100.040.0 1 0 1.11
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.12.0 (2010-10-15)
Ubuntu 9.04
___
here.
You could work on a solution along the same lines except have the days
ordered in the order of your "top choice" above (or inverse), then
pick the first (or last) entry that exists for that week. Of course,
since your choice order is not chronologlical you probably can't use
fugelpitch 09-Nov-10 12:28:
> ...how can I create a new column in the first data frame where growth form
> is picked up from the second data frame (also factors) and entered into all
> rows for a species as follows:
?merge
eg
dat1 <- merge(dat1,dat2)
Marianne
--
Marianne Pr
d a few days
ago. You can say I'm stupid and didn't look hard enough, but from a
usability/ marketing perspective this means even this cumbersome
possibility is not salient enough at the moment.
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.11.
; y, that is, the result in this case
should be:
z
[[1]]
[1] "one"
[[2]]
[1] "four" "five"
I was hoping
sapply(x,"[",y)
would work, but it doesn't.
I guess I need to sapply twice, like
sapply(x, function() { sapply(y ...
but I can't figure it ou
test[,!colnames(test)%in%"Y"]
test[,-grep("Y",colnames(test))]
bw,
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.1 (2009-12-14)
Ubuntu 9.10
__
R-help@r-project.org mailing li
all.packages("lme4a",repos="http://R-Forge.R-project.org";)
(But then something didn't work with profile() on my particular model
but I forgot what it was -- haven't had time to pursue this yet)
--
Marianne Promberger PhD, King's College
> > gsub(paste(x, collapse = "|"), "something else", y)
> [1] "something else blah" "something else blah" "something else blah"
> [4] "something else blah"
Many thanks! I didn't know about "collapse". Should
because I lack the mental flexibility to combine the fact that
I am applying gsub() to y but now want to apply that to x ... erm. :/
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.1 (2009-12-14)
Ubuntu 9.10
___
project.org/bin/linux/ubuntu/
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.1 (2009-12-14)
Ubuntu 9.04
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
2 one this is a comment;with commas. three
Wonderful, thanks a lot!
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.0 (2009-10-26)
Ubuntu 9.04
__
R-help@r-project.org mailing list
https://stat.ethz.
tried was
pipe( ... file.csv |") (with a Unix pipe symbol a the end)
Thanks!
Jon Baron 12-Dec-09 16:21:
> gsub(readLines("file.csv"),",",";")
Using gsub would be even neater, as it would really be self-contained
in R.
gsub("( [A-Za-z]+),","\\
/,/;/' file.csv")) # this does not work
I think the answer must be in ?connections, maybe pipe() but I have
fiddled with these and cannot figure it out.
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.0 (2009-10-26)
Ubuntu 9.0
elbuettel.com/code/littler.html
might come in handy as well.
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.10.0 (2009-10-26)
Ubuntu 9.04
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinf
available -- sorry if I overlooked the information online somewhere.
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.9.2 (2009-08-24)
Ubuntu 9.04
__
R-help@r-project.org mailing list
https://stat.eth
ut. Instead, I found a warning that suggests
> incompatibility (since mpg is explicitly tied to mfrow in ?par and
> layout is said incompatible with par(mfrow)).
Indeed. I did look around ?par, but due to this warning thought
anything relating to mfrow() and mfcol() would not work anyway.
es() still go to the "right plot" plot (now on the
left hand side) which gets called last.
The par(mar ... of the "scatterplot with marginal histograms" example
just set the margins of the histogram plots, then they get plotted to
the region with the next number given in the layou
https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.9.2 (2009-
ands in this order:
layout(matrix(c(1,2),1))
plot(1:10,main="left plot")
plot(10:1,main="right plot")
lines(c(3:7,7:3),col="red")
but of course now lines() gets added to the "right plot". I
Is there any way to make the lines() go to the fist plot ("left
stle.edu.au/R/devel/05/12/3454.html
Marianne
--
Marianne Promberger PhD
King's College London
London SE1 9RT
Phone: 020 7188 2590
GnuPG/PGP public key ID 80AD9916
.tex .bib .R .Rnw files welcome
__
R-help@r-project.org mailing list
https://stat.e
, and the plot should have the title
"s1" if I've called myplot(s1), "s2" if myplot(s2), etc.
I'm sure I'll be really embarrassed that this is so trivial but I
cannot figure it out.
Marianne
--
Marianne Promberger PhD
King's College London
__
answer does not
> ensure that a reasonable answer can be extracted from a given body of
> data.
> ~ John Tukey
>
> -Oorspronkelijk bericht-
> Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> Namens Marianne Promberger
> Verzonden: woensdag 10 juni
l),jitter(Better.adapt),colour=I(alpha(Second.adapt,1/5)),data=d1)
Thanks for any pointers,
Marianne
--
Marianne Promberger PhD
http://www.psych.upenn.edu/~mpromber
PGP/GnuPG public key ID 80AD9916
__
R-help@r-project.org mailing list
https://stat.et
Hi,
I'm having problems with qplot and the order of numeric factor levels.
Factors with numeric levels show up in the order in which they appear
in the data, not in the order of the levels (as far as I understand
factors!)
Here is a minimal example:
library(ggplot2)
y <- c(-1,2,0,0,-2,-1)
z <-
okies enabled in my browser.
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-pro
"|" factor notation
in lattice, like barchart(xtabs(amount~what)|month or so.
Sorry for the clutter.
m.
On Sunday, 05 October 2008, 18:12 (UTC+0100), Marianne Promberger wrote:
> Hi list,
>
> I have data in a dataframe t1, with a column for different amounts
> spent, a column wha
ies.
I figured I can do this with traditional graphics using:
barplot(xtabs(amount~what+month, data=t1),beside=T)
But I'd like to be able to do this in lattice.
I tried:
barchart(amount~what|month,t1)
But that doesn't sum the data for t1$amount for each month first.
How could I
On Saturday, 27 September 2008, 15:30 (UTC+0200), Bastian Offermann wrote:
> Hello all,
>
> one brief question
>
> I would like to remove double/triple elements from a vector, e.g.
>
> 0 1 1 1 1 2 2 2 4 5 6 6
>
> but keep one of these multiple ones. Should look like this finally:
>
> 0 1 2 4 5 6
#x27;ve used source() for that.
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide ht
n't print this e-mail unless you really need to
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-hel
),labels=c("what","ever","you","want","duh"))
?pie
would have told you this, too.
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.or
pen another plotting more plots with bmp()
or maybe x11() or whatnot and close them explicitly by giving hte
number from dev.list()
for full info
?dev.off
HTH
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
OSes. Maybe google "Rprofile".
HTH
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
ernatively
there are special commands available, look at the menu in Emacs. If
you have Emacs anyway, ESS is much more convenient than running from
the console.
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
; http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.org mailing list
https://st
ling-and-updating-r-with-aptitude/
I'm currently using 7.10 so not 100 percent sure if this works in 8.04.
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
__
R-help@r-project.org mailing list
https://st
t; and the other with people more than 50 years of age.
Assuming you have your data in a dataframe x with one column called
"age" (get the data into R e.g. with read.csv)
young <- x[x$age < 50,]
write.table(young,file="young.txt")
etc.
m.
--
Marianne
>
> 0->0
> 0.1->1
> 2->2
> 3->3
> 50->4
> 100->5 (X=5)
>
Does this do what you want?
x <- matrix(c(3,100,0.1,3,100,2,5,0,0,50),5)
y <- as.data.frame(table(x))
y$Rank <- rank(y$x)
m.
--
Marianne Promberger
Graduate student in Psychology
http:/
ssible to start R by clicking
>> the .RData file in linux as in Windows?
>> I've tried with ubuntu hardy using
>> the right button and selecting R, but does
>> not work. Is there any way to set it up?
>
> Marianne Promberger Wrote:
>> You presumably need to associ
this works.
On Ubuntu, your terminal is probably something else and may have
different syntax. (gnome-terminal maybe? then man gnome-terminal in
case the -e option doesn't work for you).
m.
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
___
On 03/03/08 12:52, Xuejun Qin wrote:
> Hi, there,
> I cannot get accurate value for calculation.
> for example:
> ld<-sqrt(1*0.05*0.95*0.05*0.95)
> 0.05*0.95-ld=-6.938894e-18
> 0.05*0.95-ld==0 is False.
>
> I met this problem in my program, how can I handle it. Thanks.
I think what you are ex
45 matches
Mail list logo