Re: [R] match from a data.frame in dependence of an ID

2014-03-28 Thread Lisa S
Try xtabs() >> df2 = data.frame(ID = c(10,10,10,10,10,11,11,12),Group = c(1,2,3,4,5,3,4,4),Value = c(10,20,30,40,50,60,70,80)) >> xtabs(df2$Value~df2$ID + df2$Group) I think this is exactly what you want. On Fri, Mar 28, 2014 at 4:51 PM, Mat wrote: > Hello togehter, > > i have a litte problem.

Re: [R] Merge two vectors into one

2014-03-24 Thread Lisa S
He wants a[1] b[1] a[2] b[2] a[3] b[3] I think you can do: x = as.vector(rbind(a, b)) On Mon, Mar 24, 2014 at 2:39 PM, Frans Marcelissen < fransiepansiekever...@gmail.com> wrote: > Why not simply > > > a<-1:3 > > b<-4:5 > > c(a,b) > [1] 1 2 3 4 5 > > > 2014-03-22 23:22 GMT+01:00 Tham Tran : >

Re: [R] Import multiple files into R

2014-03-20 Thread Lisa S
But I don't think a list can contain that much data - we dont know how big each txt file is. So I'd like to do: city.set <- c('Asheville','Charlotte') month.set <- c('Dec', 'Jan', 'Feb') comb.set <- expand.grid(city.set,month.set) comb.set$filename = paste(comb.set[,1],comb.set[,2],sep = '_') fo

Re: [R] computation

2014-01-13 Thread Lisa S
In this calculation: (dg0%*%t(dx0)) is [,1] [,2] [1,]0 -0.75 [2,]0 0.50 So: exp2 = NaN It is extremely easy to find out the issue if you go back line by line, this is a basic procedure of debugging. Please do it yourself next time. On Mon, Jan 13, 2014 at 3:09 PM, IZHAK shabso

Re: [R] Results from clogit out of range?

2013-03-04 Thread Lisa S
Thanks for the illustrative example. In my project actually my supervisor wanted to estimate the probabilities using a "conditional MLE" approach, which happens to be the case that *uses clogit() while trying to achieve aim b in your words*. I learned that clogit() is based on the sufficient stati