[R] How to manipulate this data?

2013-12-18 Thread Nitisha jha
Hi, I want my output to be like this: Value BXR abc DHH abc DHK abc def DSL def ghi DSM abc def ghi DSS def ghi DST ghi DIW abc DIL abc ghi My input dataset is this with colnames name and Value: name Value abc BXR abc DHH abc DHK def DHK def DSL ghi DSL abc DSM def DSM ghi

Re: [R] Fwd: Datatable manipulation

2013-12-10 Thread Nitisha jha
t1)[names(dat1) %in% Names1[,1]] <- Names1[,2][indx[!is.na > (indx)]] > dat1 > # aa b cc d ee > #1 1 2 3 4 5 > #2 10 9 8 7 6 > > > A.K. > > On Friday, November 22, 2013 4:46 AM, Nitisha jha > wrote: > > Hey! I got this one. :) > For the match fun

Re: [R] Datatable manipulation

2013-11-20 Thread Nitisha jha
var="ID"),cell<-as.character(interaction(variable,ID,sep="_")))[,c(4,3)] > > #or > indx <- which(dat2>0,arr.ind=TRUE) > res2 <- > data.frame(cell=paste(colnames(dat2)[indx[,2]],rownames(dat2)[indx[,1]],sep="_"),value=dat2[indx],stringsAsFactor