Hi Ahmed,
Hmmm, this seems to work for me (R-3.1.2, Linux)
legend(0,2100, legend=c("2009","2010","2012","2013","2014"),
col = 1,cex=1,lty=NA,pch=c(1,2,6,7,8),lwd=2,bty="n",pt.cex=2)
Jim
On Sat, Jan 31, 2015 at 8:49 AM, Ahmed Attia wrote:
> Hi R users,
>
> I would like to adjust the pch size
Hi,
My first question is what is your n when you say fixed n. I assume the
lambda is the mean of the poisson distribution that you want to take sample
from.
Another question is about the sample size. It does not make too much
sense to make a sample of size 1.
Let's assume that you want t
Great! Thanks. Thanks to all who tried to help.
as.vector(r[upper.tri(r)]) does it:
> e<-as.matrix(cbind(u1,u2,u3,v1,v2,v3))
> r<-cor(e); r
[,1] [,2][,3][,4] [,5][,6]
[1,] 1. 0.5240809 0.47996616 0.11200672 -0.1751103 -0.09276455
[2,] 0
If you have a symmetric matrix, you can work with the upper triangle
instead of the lower one, and you get what you want by simply using
as.vector(A[upper.tri(A)])
Example:
> a = matrix(rnorm(16), 4, 4)
> A = a + t(a)
> A
[,1] [,2] [,3][,4]
[1,] 0.3341294 0.5460334
On Jan 30, 2015, at 3:03 PM, Steven Yen wrote:
> Dear
> I use sm2vec from package corpcor to puts the lower triagonal entries of a
> symmetric matrix (matrix A) into a vector. However, sm2vec goes downward
> (columnwise, vector B), but I would like it to go across (rowwise). So I
> define a ve
Dear
I use sm2vec from package corpcor to puts the lower triagonal entries
of a symmetric matrix (matrix A) into a vector. However, sm2vec goes
downward (columnwise, vector B), but I would like it to go across
(rowwise). So I define a vector to re-map the vector (vector C). This
works. But is
The (obvious, after the fact) solution at the bottom. D'oh...
On 1/30/2015 2:07 PM, Evan Cooch wrote:
Suppose I have the following situation:
I have an array of 2 matrices, where each matrix is (2x2):
P <- array(0, c(2,2,2))
P[,,1] <- matrix(c(1,2,3,4),2,2,byrow=T);
P[,,2] <- matrix(c(5,6,7,8
Suppose I have the following situation:
I have an array of 2 matrices, where each matrix is (2x2):
P <- array(0, c(2,2,2))
P[,,1] <- matrix(c(1,2,3,4),2,2,byrow=T);
P[,,2] <- matrix(c(5,6,7,8),2,2,byrow=T);
I want to label rows and columns of each matrix in the array, such that
P would look l
Hi,
Roughly reading the code, I find this statement "phat <- x / m" is
probably incorrect since this will give you the set of 100 observed x
values /100. I redefine the function cover with three inputs: lambda
for the parameter of the poisson distribution, sample.size and
significance.
Hi,
Here is my implementation. Hope this helps.
> b
[1] 1 2 3 4 5
> c
[1] 1 2 1 3 5 4
> sapply(b,function(x)ifelse(x==c,1,0))
[,1] [,2] [,3] [,4] [,5]
[1,]10000
[2,]01000
[3,]10000
[4,]00100
[5,]00
Mixed effects models. Packages nlme and lme4 among others.
Ask further on r-sig-mixed-models list.
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll
On Fr
Hi R users,
I would like to adjust the pch size in a legend without changing the
text size, pt.cex does not do the job. R 2.15.2 32 bit.
legend(0,2100, legend=c("2009","2010","2012","2013","2014"),
col = 1,cex=1,lty=NA,pch=c(1,2,6,7,8),lwd=2,bty="n")
Thanks
Ahmed Attia, Ph.D.
Agronomist & Soil
Dear John,
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John
> Sorkin
> Sent: January-30-15 3:43 PM
> To: r-help@r-project.org
> Subject: [R] repeated measures ANOVA
>
> Windows 7, R 3.1.0
>
> How does one run repeated measures ANOVA using R for
Hi Bastian,
While doing the research for sequential event intervals, I found a
paper by Dr Andreas Eckner, who studies this topic. I suggest you
check his research page:
http://www.eckner.com/research.html
and I would like to know if you find it helpful.
Jim
On Fri, Jan 30, 2015 at 9:52 PM, Ba
Windows 7, R 3.1.0
How does one run repeated measures ANOVA using R for
(1) A balanced design
(2) An unbalanced design.
so that one will get an ANOVA table?
I have seen references to the Anova function in the car package, but this seems
to have been deprecated.
Thank you,
John
John David Sorki
On Jan 30, 2015, at 2:20 AM, n omranian via R-help wrote:
> Hi All,
> I'm getting actually nuts. I don't understand the following lines in R:
> Here is the data, all rows are exactly the same!
Their print representation may be "exactly the same", but their internal values
may differ by an amoun
You successfully used an 'expression' object in your first example
plot(1,1,xlab=expression(paste("D50 [", mu,"m]")))
so use a vector of expressions in your second example
nams<-c(expression(P[205]~"[%]"), expression(paste("D50 [", mu, "m]")))
par(mfrow=c(2,1))
for (i in 1:2) plot(1, 1,
I don't think this is an R question, since you want to loop from the
windows command line rather than in R. Perhaps see
http://stackoverflow.com/questions/11192039/how-to-do-a-for-loop-in-windows-command-line
On Thu, Jan 29, 2015 at 11:26 PM, nevil amos wrote:
> Hi,
>
> I need to run multiple ite
Hi,
Take a look at the argument "each" from rep().
You could do that (there might be something shorter):
paste(rep(v1,each=3), 1:3, sep="_")
HTH,
Ivan
--
Ivan Calandra, ATER
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26
> paste(rep(v1, each=3), 1:3, sep="_")
[1] "a_1" "a_2" "a_3" "b_1" "b_2" "b_3" "c_1" "c_2" "c_3"
>
Is this what you are looking for? I hope this helps.
Chel Hee Lee
On 1/30/2015 7:34 AM, Knut Hansen wrote:
I have a vector of several character elements:
v1 <- c("a", "b", "c")
I want each of t
I have a vector of several character elements:
v1 <- c("a", "b", "c")
I want each of these elements to be repeated n times and the number of the
repetition added as part of the element text, hence rep() will not work. For
n=3 the result would be:
v2 <- c("a_1", "a_2", "a_3", "b_1", "b_2", "b_3",
hallo, i search for a possibillity to aggregate a time series by non
regular periods (events)
As an example i have a precipitation time series
## generate some smooth timeseries
library(zoo)
library(hydrostats)
## some example data
## ## ## ##
x.pr <- c(0, 0, 0, 0.2, 0.8, 0.7, 0, 0, 0, 0.6,
Hi
Thanks for the answer. Previous attempts were closer to my intention and are
easier for me to understand and extend.
Cheers
Petr
> -Original Message-
> From: Chel Hee Lee [mailto:chl...@mail.usask.ca]
> Sent: Friday, January 30, 2015 3:10 PM
> To: PIKAL Petr; Richard M. Heiberger; S
Why don't try this?
> nams<-c("P2O5 ['%']", "D50 [mu*m]")
> pdf("test.pdf")
> for(i in 1:2)
+ plot(1,1,xlab=parse(text=(bquote(.(nams[i])
> dev.off()
Is this what you are looking for? I hope this helps.
On 1/30/2015 7:54 AM, PIKAL Petr wrote:
Thanks
So the key is to put expression(s) dir
Thanks
So the key is to put expression(s) directly into pool of annotations. I should
think about it myself, stupid me.
I normally use paste but your constructions are much more readable.
thanks again.
Petr
> -Original Message-
> From: Richard M. Heiberger [mailto:r...@temple.edu]
> Sen
On 30/01/2015 8:17 AM, Knut Krueger wrote:
Am 30.01.2015 um 12:51 schrieb Duncan Murdoch:
> You are mixing up formatting with storage. Floating point numbers will
> be displayed without decimals if they are close enough to whole numbers.
>
> Duncan Murdoch
>
Ok, I am talking from display
data
I would do this
names <- c(expression(D[50]~mu*m), expression(P[2]*O[5]*"%"))
for (i in 1:2) plot(1, 1, xlab=names[i])
On Fri, Jan 30, 2015 at 7:33 AM, PIKAL Petr wrote:
> Dear all
>
> I usually find out how I can use expressions in picture annotationmyself :-)
>
> plot(1,1, xlab=expression(past
> nams<-c("P2O5 [%]", "D50 [mum]")
These are strings; plotmath is invoked on expressions.
Also, in an expression, [] has special meaning (it's treated as a subscripted
index), so a space followed by '[' causes an error and even if that didn't
happen, [] would not give units in square brackets.
H
Am 30.01.2015 um 12:51 schrieb Duncan Murdoch:
You are mixing up formatting with storage. Floating point numbers will
be displayed without decimals if they are close enough to whole numbers.
Duncan Murdoch
Ok, I am talking from display
data = matrix(c(1:16),nrow=4,ncol=4) #create matrix
da
Hi everyone,
I try making decision trees and random forest using the packages rpart and
party. I'm already stuck at t he first step. Each time when I enter the code
either 1. R takes more than an hour. I haven't waited long enough to see if
there's a result but it doesn't look like it! When I
Dear all
I usually find out how I can use expressions in picture annotationmyself :-)
plot(1,1, xlab=expression(paste("D50 [", mu,"m]")))
However when I want to use this programmatically I am rather lost. Is there
anybody who can shed a light on such annotation?
nams<-c("P2O5 [%]", "D50 [mum]"
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut
> Krueger
> Sent: Friday, January 30, 2015 12:32 PM
> To: r-help@r-project.org
> Subject: Re: [R] digits in matrix
>
> Am 30.01.2015 um 11:50 schrieb PIKAL Petr:
> >
> > You cannot. Matrix is a v
Well, yes, I do agree with you.
And thanks a lot, I found the FAQ 7.31. very useful.
Best,N.
On Friday, January 30, 2015 12:44 PM, Duncan Murdoch
wrote:
On 30/01/2015 5:22 AM, n omranian via R-help wrote:
> Hi All,
> I'm getting actually nuts. I don't understand the following line
On 30/01/2015 6:31 AM, Knut Krueger wrote:
> Am 30.01.2015 um 11:50 schrieb PIKAL Petr:
>>
>> You cannot. Matrix is a vector with dimensions so basically it has to have
>> the same mode and type of data.
>>
>> The only way I can think about is to split matrix to 3 matrices before
>> making calcul
On 30/01/2015 5:22 AM, n omranian via R-help wrote:
> Hi All,
> I'm getting actually nuts. I don't understand the following lines in R:
> Here is the data, all rows are exactly the same!
>> ord_data[pid,]
> c0m2 c0m4 c0m8 c0m16c0m24c0m48 c0p2
> c0p4 c0p8
Am 30.01.2015 um 11:50 schrieb PIKAL Petr:
You cannot. Matrix is a vector with dimensions so basically it has to have the
same mode and type of data.
The only way I can think about is to split matrix to 3 matrices before making
calculation an keep those 3 matrices separate.
Cheers
Petr
bu
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut
> Krueger
> Sent: Friday, January 30, 2015 11:21 AM
> To: r-h...@stat.math.ethz.ch
> Subject: [R] digits in matrix
>
> I have a matrix winth integer values after an arithmetic calulation
> How ca
Hi All,
I'm getting actually nuts. I don't understand the following lines in R:
Here is the data, all rows are exactly the same!
> ord_data[pid,]
c0m2 c0m4 c0m8 c0m16 c0m24 c0m48 c0p2 c0p4
c0p8 c0p16 c0p24 c0p48 c24m2 c24m4 c24m8 c24m16
1333
Hi All,
I'm getting actually nuts. I don't understand the following lines in R:
Here is the data, all rows are exactly the same!
> ord_data[pid,]
c0m2 c0m4 c0m8 c0m16 c0m24 c0m48 c0p2 c0p4
c0p8 c0p16 c0p24 c0p48 c24m2 c24m4 c24m8 c24m16
1333
I have a matrix winth integer values after an arithmetic calulation
How can prevent the [1:3]1:3] part of the matrix to be converted to floats
data = matrix(c(1:16),nrow=4,ncol=4) #create matrix
data[4,] = data[4,]/3
data[,4] = data[,4]/3
data
Kind regards Knut
___
40 matches
Mail list logo