Displaying 20 results from an estimated 37 matches for "promberger".
2010 Feb 22
3
gsub patterns from vector elements w/out loop?
...ing else",y)
}
Surely, there must be a less kludgy way?
I tried looking at the different apply()s but am not getting anywhere,
partly 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
2010 Nov 29
1
cross tabulate variables by subject id
...o AC
and/or AD respectively.
I can get the first step by making an extra 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 2.12.0 (2010-10-15)
Ubuntu 9.04
2011 Feb 02
1
pass nrow(x) to dots in function(x){plot(x,...)}
...<- function(x, ...) {
ns <- nrow(x)
barplot(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's College London
http://promberger.info
R version 2.12.0 (2010-10-15)
Ubuntu 9.04
2009 Dec 12
1
read.csv to read output of system()?
...o \"one,two,three\" > file.csv") # create mockup file
read.csv(file=system("sed -e 's/,/;/' 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.04
2010 Aug 24
1
Index list by other list (w/ logical elements)?
..."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 out.
Many thanks for any pointers
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.11.1 (2010-05-31)
Ubuntu 9.04
2008 Oct 05
1
barchart for aggregated (sum) data in lattice?
...aditional 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 do that?
Thanks,
Marianne
--
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber
2009 Oct 09
3
"Use R" -- term and logo copyright?
...enquired with the agrocampus-ouest.fr website about the logo but was
pointed to r-project.org and the R development core team. I thought in
that case it might be best to ask here to have the answer publicly
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
2009 Oct 03
2
add lines() to 1st plot in layout() after calling 2nd plot()?
...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 plot")?
Marianne
--
Marianne Promberger PhD, King's College London
http://promberger.info
R version 2.9.2 (2009-08-24)
Ubuntu 9.04
2009 Sep 02
1
get function to return object "name"?
...ect,main=X) }
where X is the expression I'm looking for, 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
2009 Jun 10
1
ggplot, qplot: alpha channel for colors corresponding to factor
...ter.adapt),Second.adapt=c(Second.adapt))
library(ggplot2)
qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,data=d1)
# follwoing doesn't work:
qplot(jitter(Goodall),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
2009 Oct 03
1
if else statement error
Hello,
I am doing a if else statement in R. But it always comes out error such as
'unexpected symbol'
There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2,
a=3; all other situations, a=6. I don't know where it is wrong.
Here is my code
ini=3
b=4
if (ini==1) {
a=3
}
else if (ini>1 and b>2 ) {
a=3
}
else {a=6}
Thanks a
2010 Jan 31
1
Help with R in ubuntu
Dear R users:
Maybe it is a silly question, but I'm don't understand what am I doing wrong.
In a new karmik koala ubuntu installation I compile the last patched 2.10.1 version of R.
Every thing was right (I install all the dev libraries I need).
First I type:
./configure --enable-R-shlib
And I obtain:
R is now configured for i686-pc-linux-gnu Source directory: .
2010 Feb 22
3
env() for lme4
I have been looking at a draft of Doug Bate's book on mixed effects models
(http://lme4.r-forge.r-project.org/book), and in chapter one (section "1.4.2
Matrices and Vectors in the Fitted Model Object", to be exact) he refers to the
function env() for checking the environment of a fitted lmer object. This
function does not appear under help, and I have not been able to find
2010 Nov 11
2
Number above the bar?
Hi
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?
Sorry for bad English, and I do hope that you understand what im after.
//Joel
--
View this message in context: http://r.789695.n4.nabble.com/Number-above-the-bar-tp3037438p3037438.html
Sent from the R help mailing list archive at Nabble.com.
2008 May 25
3
need help for building R in Ubuntu 8.04
Hi everyone
I have been trying to build R in ubuntu 8.04 from its source code but am
getting the following error.
configure: error: --with-x=yes (default) and X11 headers/libs are not
available
Please help me and consider me a newbie in linux
thanks in advance
[[alternative HTML version deleted]]
2008 May 25
3
need help for building R in Ubuntu 8.04
Hi everyone
I have been trying to build R in ubuntu 8.04 from its source code but am
getting the following error.
configure: error: --with-x=yes (default) and X11 headers/libs are not
available
Please help me and consider me a newbie in linux
thanks in advance
[[alternative HTML version deleted]]
2010 Nov 07
3
Integrate and mapply
...on integrating a function that is a vector.
I have a function - vector which each element is different. And,
naturally, function integrate() does not work
I checked the article of U. Ligges and J. Fox (2008) about code
optimization "How Can I Avoid This Loop or Make It Faster?" on
http://promberger.info/files/rnews-vectorvsloops2008.pdf.
Their advice did not help me, because they advised a solution, when
function was the same, but limits of the integral were vectors. I
have got everything other way around. I could not get any result.
I would be very grateful for an advice on this matter.
The...
2010 Feb 23
5
deleting column from data frame
Hi to all,
test <- data.frame("X"=c(1:4),"Y"=c(5:8),"Z"=c(8:11))
test <- test[,-2]
Is there a way to specify the col name "Y" to delete instead the number?
Kind regards Knut
2010 Nov 09
4
help to add a new column filled with value 1
Dear All,
I have a data frame with 5 column and 201 row data. I want to add one
more column between column 1 and 2 with value of 1. So the new column
has to be the second column filled with 1. Any help will be
appreciated.
Thanks for your time.
Thanks & Rg
Mohan L
2010 Nov 09
2
help to merge two data frame if name matches
Dear All,
I have two data like this :
$cat main.csv
name,id,memory,storage
mohan,1,100.20,1.10
ram,1,200,100
kumar,1,400,50
xxx,1,100,40
aaa,1,800,45
mount,1,200,80
> main <- read.csv(file='main.csv',sep=',' , header=TRUE)
> main
name id memory storage
1 mohan 1 100.2 10
2 ram 1 200.0 100
3 kumar 1 400.0 50
4 xxx 1