#I have got 3 dependent variables:
Y<-matrix(c(3,5,6,3,4,2,4,5,3,2,3,5,6,3,4,2,4,5,3,2,3,5,6,3,4,2,4,5,3,2), nrow
= 10, ncol=3, byrow=TRUE)
#I've got one independent variable:
X<-matrix(c(42,54,67,76,45,76,54,87,34,65), nrow = 10, ncol=1, byrow=TRUE)
summary(lm(Y~X))
and the result is as bel
hehe...
very true sir; I apologize, that was very straightforward. Thank you for
your time.
--
View this message in context:
http://r.789695.n4.nabble.com/Subsampling-out-of-site-abundance-matrix-tp3263148p3263598.html
Sent from the R help mailing list archive at Nabble.com.
___
Dear latticists,
Getting legend and graph line types synchronized has been a challenge in
lattice; the last example below that works looks ridiculously ugly for such
a simple job, I am sure there is a more elegant solution.
When trying this out, I found a feature which I found confusing: why are
Dear all I would like to plot the contents of a matrix as an Image. I found
this code here http://www.phaget4.org/R/image_matrix.html but this is not only
what I want. Instead of having inside every cell the color of the cell it would
be nice to have also the arithmetic value over the background
Yes, thnx... Typo :$
On Mon, Feb 7, 2011 at 8:23 AM, Berend Hasselman wrote:
>
>
> Tsjerk Wassenaar wrote:
>>
>> Hi,
>>
>> Does it alleviate things if you rewrite the sums to avoid large products?
>>
>> For I even:
>> J+I*(N-I/2)-(N-I/2)
>>
>
> Shouldn't that be
>
> J+I*(N-I/2)-(N+I/2) ?
>
> Ber
Tsjerk Wassenaar wrote:
>
> Hi,
>
> Does it alleviate things if you rewrite the sums to avoid large products?
>
> For I even:
> J+I*(N-I/2)-(N-I/2)
>
Shouldn't that be
J+I*(N-I/2)-(N+I/2) ?
Berend
--
View this message in context:
http://r.789695.n4.nabble.com/Fortran-and-long-integers-
Hi,
Does it alleviate things if you rewrite the sums to avoid large products?
For I even:
J+I*(N-I/2)-(N-I/2)
For I odd:
J+I*(N-(I+1)/2)-(N-(I+1)/2)+(I+1)/2
Hope it helps,
Tsjerk
On Mon, Feb 7, 2011 at 7:21 AM, Berend Hasselman wrote:
>
>
> Earl F Glynn wrote:
>>
>>
>> 2-byte (16 bit) signe
Earl F Glynn wrote:
>
>
> 2-byte (16 bit) signed integers would have a range from -32768 to
> +37267. So, it looks like you may be using 2-byte integers and 46,300
> would definitely cause an overflow with 16-bit integers.
>
> I haven't used Fortran for a long time, but there could be a com
Hey all,
I can't for the life of me figure out what I'm missing here. I'm trying
to change the color of the line in a time series type plot. I can
change the point colors and symbols no problem, but for some reason the
colors do not get passed to the lines, regardless of if I do type="b" or
Peter Langfelder wrote:
Hi all,
I'm hoping someone more knowledgeable in Fortran than I can chime in
with opinion.
I'm the maintainer of the flashClust package that implements fast
hierarchical clustering. The fortran code fails when the number of
clustered objects is larger than about 46300.
On Feb 6, 2011, at 9:35 PM, B77S wrote:
I figured there would be an even more straightforward way, but that
works
David, thanks.
I am rather puzzled. What prior experience with computing would lead
you to believe that one line of code was not a straightforward method
to do multinomial
On Sun, Feb 6, 2011 at 6:16 PM, Christopher Porter wrote:
> Hello. I came across your response in an R forum and could use your help. I
> have a data set with 472 rows. I want to delete rows 416 through 472. The
> name of my data set is MERGE.
>
> I am an extreme R novice. How do I write a script
?subset
On Mon, Feb 7, 2011 at 7:46 AM, Christopher Porter wrote:
> Hello. I came across your response in an R forum and could use your help. I
> have a data set with 472 rows. I want to delete rows 416 through 472. The
> name of my data set is MERGE.
>
> I am an extreme R novice. How do I writ
Hi,
On Sun, Feb 6, 2011 at 6:16 PM, Christopher Porter wrote:
> Hello. I came across your response in an R forum and could use your help. I
> have a data set with 472 rows. I want to delete rows 416 through 472. The
> name of my data set is MERGE.
Try this:
MERGE2 <- MERGE[-c(416:472), ]
Che
I figured there would be an even more straightforward way, but that works
David, thanks.
There has to be a way to get the output I want/need (see below). I tried to
bind or merge the elements of "apply(samptbl, 2, table)" but with no
success. I could probably make a for loop with a merge stat
Hello. I came across your response in an R forum and could use your help. I
have a data set with 472 rows. I want to delete rows 416 through 472. The name
of my data set is MERGE.
I am an extreme R novice. How do I write a script to accomplish this?
Thank you.
---
Christopher H. Porter, M.A
Hugo - thanks for the link, but that's a bit beyond me right now. I have
ideas of the distribution for some 'nuggets', but others might be new. I
hope that there's an easier way to pick them out than going after
pre-defined patterns...
Greg - I use bioconductor for a lot of processing, but I'm no
?ave
> a
[1] 2 3 3 4
> cbind(a, ave(a, a, FUN=length))
a
[1,] 2 1
[2,] 3 2
[3,] 3 2
[4,] 4 1
>
On Sun, Feb 6, 2011 at 8:21 PM, Carrie Li wrote:
> Hello R-helpers,
>
> I have a question about counting numbers.
> Here is a simple example.
>
> a=c(2, 3, 3,4)
>> table(a)
> a
> 2 3 4
> 1 2 1
>
Many thanks!
all methods work well! thanks again!
On Sun, Feb 6, 2011 at 8:42 PM, Ray Brownrigg
wrote:
> It's not quite clear what the OP really wanted. A more general solution
> may be:
>
> > a=c(4, 3, 2, 3)
> > ta <- table(a)
> > ta
> a
> 2 3 4
> 1 2 1
> > ta[as.character(a)]
> a
> 4 3 2 3
> 1
On Feb 6, 2011, at 7:41 PM, Hadley Wickham wrote:
There's definitely something amiss with aggregate() here since
similar
functions from other packages can reproduce your 'control' sum. I
expect
ddply() will have some timing issues because of all the subgrouping
in your
data frame, but data
It's not quite clear what the OP really wanted. A more general solution may be:
> a=c(4, 3, 2, 3)
> ta <- table(a)
> ta
a
2 3 4
1 2 1
> ta[as.character(a)]
a
4 3 2 3
1 2 1 2
>
HTH
Ray Brownrigg
On Mon, 07 Feb 2011, Jorge Ivan Velez wrote:
> Hi
Hi Carrie,
Try
> x <- rle(a)
> rep(x$lengths, x$lengths)
[1] 1 2 2 1
HTH,
Jorge
On Sun, Feb 6, 2011 at 8:21 PM, Carrie Li <> wrote:
> Hello R-helpers,
>
> I have a question about counting numbers.
> Here is a simple example.
>
> a=c(2, 3, 3,4)
> > table(a)
> a
> 2 3 4
> 1 2 1
>
> so, I can to
Hello R-helpers,
I have a question about counting numbers.
Here is a simple example.
a=c(2, 3, 3,4)
> table(a)
a
2 3 4
1 2 1
so, I can to create another variables that has the corresponding counting
numbers.
In this case, I want to have:
b=c(1,2,2,1)
Is there any way coding for this ?
Thanks
> There's definitely something amiss with aggregate() here since similar
> functions from other packages can reproduce your 'control' sum. I expect
> ddply() will have some timing issues because of all the subgrouping in your
> data frame, but data.table did very well and the summaryBy() function i
Hi:
There's definitely something amiss with aggregate() here since similar
functions from other packages can reproduce your 'control' sum. I expect
ddply() will have some timing issues because of all the subgrouping in your
data frame, but data.table did very well and the summaryBy() function in t
you can use layout to setup 4 plot areas; 3 for the graphs and then along one
on the right for the legend
Sent from my iPad
On Feb 6, 2011, at 2:41, Matt Cooper wrote:
> Hi All,
>
> BG: Will try be brief. I'd like 3 graphs on a page (below each other
> mfrow=c(3,1)), saved to pdf. The three p
Another possibility is
mapply(rbind,list1,list2,SIMPLIFY=FALSE)
- Phil Spector
Statistical Computing Facility
Department of Statistics
?aggregate
?tapply
data.table package
example data and output would have been useful
Sent from my iPad
On Feb 6, 2011, at 15:02, Ning Cheng wrote:
> I've got a fund performance report for the last year,in which one
> column states their management style,i.e. long/short,market neutral. I
> want
On Feb 6, 2011, at 3:25 PM, B77S wrote:
Hello,
How can I randomly sample individuals within a sites from a site
(row) X
species abundance (column) data frame or matrix? As an example, the
matrix
"abund2" made below.
# (sorry, Im a newbie and this is the only way I know to get an
e
Try 'data.table' package. It took 3 seconds to aggregate the 500K
levels: Is this what you were after?
> # note the characters are converted to factors that 'data.table' likes
> dat=data.frame(
+x1=sample(c(NA,'m','f'), 2e6, replace=TRUE),
+x2=sample(c(NA, 1:10), 2e6, replace=TRU
garciap usal.es> writes:
> this is my first time, and just begin to use R. But I've a question about
> optimization using optimx library. It could sound stupid by I'm a bit
> affraid with the problem, because anything I try, anything Error.
> The procedure was:
> optimx(par="10,71,1",fn=(Prey*P
Dear all,
this is my first time, and just begin to use R. But I've a question about
optimization using optimx library. It could sound stupid by I'm a bit
affraid with the problem, because anything I try, anything Error.
The procedure was:
optimx(par="10,71,1",fn=(Prey*Provisioning)/Risk, control
By the way, thanks for sending that formula, it's quite thoughtful of you to
send an answer with an actual working line of code!
When I experimented with ddply earlier last week I couldn't figure out the
syntax for a single line aggregation, so it's good to have this example. I
will likely use it
I've got a fund performance report for the last year,in which one
column states their management style,i.e. long/short,market neutral. I
want to categorize all the fund into subgroups by their management
style.How can I do that?
__
R-help@r-project.org m
Hello,
How can I randomly sample individuals within a sites from a site (row) X
species abundance (column) data frame or matrix? As an example, the matrix
"abund2" made below.
# (sorry, Im a newbie and this is the only way I know to get an example
on here)
abund1 <-c(150, 300, 0, 36
Try to use formula notation and use na.action=na.pass
It is all described in the help(aggregate)
У Няд, 06/02/2011 у 14:54 -0600, Gene Leynes піша:
> On Fri, Feb 4, 2011 at 6:54 PM, Ista Zahn wrote:
>
> > >
> > > However, I don't think you've told us what you're actually trying to
> > > accompl
Thank you for your reply and sorry for my ambiguity.
I computed:
summary(anova1 <- aov(math ~ as.factor(schoolid), data=nels88))
ICC1(anova1)
ICC1 comes from the multilevel package. I have found an article where it
is pointed out that with this formula:
> 34.011/(34.011+72.256)
[1] 0.320052
On Fri, Feb 4, 2011 at 6:54 PM, Ista Zahn wrote:
> >
> > However, I don't think you've told us what you're actually trying to
> > accomplish...
> >
>
I'm trying to aggregate the y value of a big data set which has several x's
and a y.
I'm using an abstracted example for many reasons. Partially,
On Sun, Feb 06, 2011 at 04:31:43PM -0200, Leandro Colli wrote:
> This is my first time here at R Forum!
>
> I am a new user of R. I am very happy with this fabulous software!
>
> I know how to use greps, fors, seeds, %in%, paste, etc.
>
> But I need to know how to use a value of an
Hi Rohit,
It is fine if you are using the Newton's method just as an excuse to learn
Rcpp. If, however, your main goal is to develop a package to implement
Newton's method, then you need to stop and look at the numerous optimization
packages available in R. A good place to start would be the
Dear R helpers,
I wonder how to use a character vector as an input argument to setkey
(data.table package).
The following works:
library(data.table)
test.dt <- data.table(expand.grid(a=1:30,b=LETTERS),c=seq(30*26))
setkey(test.dt,a,b)
I like a similar function, but can accept c('a','b') as an in
Hi all,
I'm hoping someone more knowledgeable in Fortran than I can chime in
with opinion.
I'm the maintainer of the flashClust package that implements fast
hierarchical clustering. The fortran code fails when the number of
clustered objects is larger than about 46300. My guess is that this is
be
will this do it for you:
> lapply(seq(length(list1)), function(i)rbind(list1[[i]], list2[[i]]))
[[1]]
[,1] [,2] [,3] [,4] [,5]
[1,]16 11 16 21
[2,]27 12 17 22
[3,]38 13 18 23
[4,]49 14 19 24
[5,]5 10 15 20 25
[6,] 10 11
Hi, I am wondering whether we can apply 'cbind/rbind' on many **equivalent**
list objects. For example please consider following:
> list1 <- list2 <- vector("list", length=2); names(list1) <- names(list2)
<- c("a", "b")
> list1[[1]] <- matrix(1:25, 5)
> list1[[2]] <- matrix(2:26, 5)
> list2[[1]] <
This is my first time here at R Forum!
I am a new user of R. I am very happy with this fabulous software!
I know how to use greps, fors, seeds, %in%, paste, etc.
But I need to know how to use a value of an aboject in a line command?
Example:
> i
[1] "TP53"
> TP53
V1 V2 V3
On 6 February 2011 at 20:58, Rohit Pandey wrote:
| Hi,
|
| I have been using R for close to two years now and have grown quite
| comfortable with the language. I am presently trying to implement an
| optimization routine in R (Newton Rhapson). I have some R functions that
| calculate the gradient
On 02/06/2011 07:28 AM, Rohit Pandey wrote:
> Hi,
>
> I have been using R for close to two years now and have grown quite
> comfortable with the language. I am presently trying to implement an
> optimization routine in R (Newton Rhapson). I have some R functions that
> calculate the gradient and h
On Sun, Feb 6, 2011 at 10:56 AM, David Winsemius wrote:
>
> On Feb 6, 2011, at 10:28 AM, Rohit Pandey wrote:
>
>> Hi,
>>
>> I have been using R for close to two years now and have grown quite
>> comfortable with the language. I am presently trying to implement an
>> optimization routine in R (Newt
On Feb 6, 2011, at 10:28 AM, Rohit Pandey wrote:
Hi,
I have been using R for close to two years now and have grown quite
comfortable with the language. I am presently trying to implement an
optimization routine in R (Newton Rhapson). I have some R functions
that
calculate the gradient and h
Hello Federico,
You should try sending this to the mixed models mailing list (link
below). Also, it would probably help to know what the data looks like. With the
information you provide, it's hard to say what the problem could be.
r-sig-mixed-mod...@r-project.org
Best,
~Jason
On 2011.02.06, Fe
Hi,
I have been using R for close to two years now and have grown quite
comfortable with the language. I am presently trying to implement an
optimization routine in R (Newton Rhapson). I have some R functions that
calculate the gradient and hessian (pre requisite matrices) fairly
efficiently. Now,
Super Phil!!
Thank you very much!!
Mariana
On Sat, Feb 5, 2011 at 8:54 PM, Phil Spector wrote:
> If the seq(5,205) was a typo, and should have been
> seq(5,20,5), then what you're looking for is the outer
> product of x and y:
>
>> x = seq(5,20,5)
>> y = seq(5,20,5)
>> x %o% y
>
> [,1] [,2]
Hi dears while modeling an interaction random effect in lmer i receive the
instantaneous error message
> ldlM4<-lmer(ldl~rt*cd4+age+rf+pharmac+factor(hcv)+
+ hivdur+(rt:cd4|id),na.action=na.omit,REML=F)
*Warning message:
In mer_finalize(ans) : false convergence (8)
*
I think the matter lies in syn
See comments inline.
On 2011-02-06 03:17, Jinsong Zhao wrote:
Hi there,
I have a data frame as listed below:
> Ca.P.Biomass.A
P Biomass
1 334.5567 0.287
2 737.5400 0.571
3 894.5300 0.639
4 782.3800 0.5836667
5 857.5900 0.600
6 829.2700 0.588
I have fit the
another option is to use reshape()
x<-data.frame(x1=rep(1:3,each=3),x2=letters[1:9])
x$id<-rep(1:3,3)
dur<-reshape(x,timevar="x1",idvar="id",direction="wide")
dur<-dur[,-1]
colnames(dur) <- paste("d", unique(x$x1), sep="")
dur
cheers, Victor
___
Jinsong Zhao yeah.net> writes:
>
> Hi there,
>
> I have fitted a sample (with size 20) to a normal and/or logistic
> distribution using fitdistr() in MASS or fitdist() in fitdistrplus
> package. It's easy to get the parameter estimates. Now, I hope to report
> the confidence interval for tho
Hi André,
try this:
df1 <- data.frame(x1 = rep(1:3, each=3), x2=letters[1:9])
dfs <- split(df1, df1$x1)
df2 <- data.frame(sapply(dfs, FUN="[[", "x2"))
colnames(df2) <- paste("d", unique(df1$x1), sep="")
df2
HTH
Patrick
Am 06.02.2011 12:13, schrieb André de Boer:
Hello,
Can someone give me
Here is one way of doing it:
> x
x1 x2 row
1 1 a 1
2 1 b 2
3 1 c 3
4 2 d 1
5 2 e 2
6 2 f 3
7 3 g 1
8 3 h 2
9 3 i 3
> # create indices for new table
> x$row <- ave(x$x1, x$x1, FUN=seq_along)
> # create output matrix
> result <- matrix('', max(x$row), max(x$x1))
Package boot is support software for a book: have you consulted it?
It answers all your questions, and has copious examples.
On Sun, 6 Feb 2011, Sascha Vieweg wrote:
Hello R users
I am quite new to bootstrapping. Now, having some data x,
R: set.seed(1234)
R: x <- runif(300)
I want to
Hi there,
I have fitted a sample (with size 20) to a normal and/or logistic
distribution using fitdistr() in MASS or fitdist() in fitdistrplus
package. It's easy to get the parameter estimates. Now, I hope to report
the confidence interval for those parameter estimates. However, I don't
find
Hello R users
I am quite new to bootstrapping. Now, having some data x,
R: set.seed(1234)
R: x <- runif(300)
I want to bootstrap simple statistics, mean and quantiles (.025,
.975). Currently, I run a loop
R: res <- as.data.frame(matrix(ncol = 3, dimnames = list(NULL,
...c("M"
Hi there,
I have a data frame as listed below:
> Ca.P.Biomass.A
P Biomass
1 334.5567 0.287
2 737.5400 0.571
3 894.5300 0.639
4 782.3800 0.5836667
5 857.5900 0.600
6 829.2700 0.588
I have fit the data using logistic, Michaelis–Menten, and linear model,
they all gi
Hello,
Can someone give me hint to change a data.frame.
I want to split a column in more columns depending on the value of a other
column.
Thanks for the reaction,
Andre
Example:
> dat
x1 x2
1 1 a
2 1 b
3 1 c
4 2 d
5 2 e
6 2 f
7 3 g
8 3 h
9 3 i
in
> dur
d1 d2 d3
1 a d g
On Sun, Feb 6, 2011 at 3:56 PM, David Winsemius wrote:
>
> Why not just use xpd=T inside legend()?
>
>
> David Winsemius, MD
> West Hartford, CT
>
>
I had a feeling I'd look stupid after sending that. Thanks, works great. For
some reason I thought if xpd would have to be set to T at the par() leve
On Feb 6, 2011, at 2:41 AM, Matt Cooper wrote:
Hi All,
BG: Will try be brief. I'd like 3 graphs on a page (below each other
mfrow=c(3,1)), saved to pdf. The three plot data on the same subject
so I'm
having one legend, to the right of the center graph. I'm using
mar=c(5,15,4,15) to bring th
>> When I came to David's comment, I understood the theory, but not the
>> numbers in his answer. I wanted to see the MASS mca answers "match
>> up" with SAS, and the example did not (yet).
I am inclined to write, "O yea of little faith." David showed perfectly well
that when the results of th
66 matches
Mail list logo