search for: lst3

Displaying 8 results from an estimated 8 matches for "lst3".

Did you mean: lst
2013 Jun 04
0
choose the lines2
...is helps: dat1<- read.csv("dat7.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t") dat.bru<- dat1[!is.na(dat1$evnmt_brutal),] fun2<- function(dat){?? ????? lst1<- split(dat,dat$patient_id) ??? lst2<- lapply(lst1,function(x) x[cumsum(x$evnmt_brutal==0)>0,]) ??? lst3<- lapply(lst2,function(x) x[!(all(x$evnmt_brutal==1)|all(x$evnmt_brutal==0)),]) ??? lst4<- lst3[lapply(lst3,nrow)!=0] ??? lst5<- lapply(seq_along(lst4),function(i){ ??? ??? ??? ??? ???? do.call(rbind,lapply(which(lst4[[i]]$evnmt_brutal==1),function(x) { ??? ??? ??? ??? ??? ??? ??? ??? ???...
2013 Jun 08
0
data
...to select only a pair of rows (dummy=0 and dummy=1) for each lists. fun1<- function(dat,percent,number){??? ??? lst1<- split(dat,list(dat$year,dat$industry)) ??? lst1New<- lapply(lst1,function(x) x[!(all(x$dummy==0)|all(x$dummy==1)),]) ??? lst2<- lst1New[lapply(lst1New,nrow)>0] ??? lst3<- lapply(lst2,function(x){ ??? ??? ??? ??? lapply(x$dimension,function(y){ ??? ??? ??? ??? ? x1<- x[(y < (x$dimension+(x$dimension*percent))) & (y > (x$dimension-(x$dimension*percent))),]??? ??? ??? ??? ??? ??? })??? ??? ??? ??? ??? }) ??? lst4<- lapply(lst3,function(x){ ??? ??...
2013 Jun 04
0
choose the lines2
...do this: dat1<- read.csv("dat7.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t") dat.bru<- dat1[!is.na(dat1$evnmt_brutal),] fun2<- function(dat){? ????? lst1<- split(dat,dat$patient_id) ??? lst2<- lapply(lst1,function(x) x[cumsum(x$evnmt_brutal==0)>0,]) ??? lst3<- lapply(lst2,function(x) x[!(all(x$evnmt_brutal==1)|all(x$evnmt_brutal==0)),]) ??? lst4<- lst3[lapply(lst3,nrow)!=0] ??? lst5<- lapply(seq_along(lst4),function(i){ ???????????????????? do.call(rbind,lapply(which(lst4[[i]]$evnmt_brutal==1),function(x) { ????????????????????????????????????...
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to create two separated samples with the same number os firms where #one firm in the first have a corresponding
2013 May 27
0
choose the lines
...ry this: dat1<- read.csv("dat7.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t") dat.bru<- dat1[!is.na(dat1$evnmt_brutal),] fun1<- function(dat){??? ? ??? lst1<- split(dat,dat$patient_id) ??? lst2<- lapply(lst1,function(x) x[cumsum(x$evnmt_brutal==0)>0,]) ??? lst3<- lapply(lst2,function(x) x[!(all(x$evnmt_brutal==1)|all(x$evnmt_brutal==0)),]) ??? lst4<-lapply(lst3,function(x) {vect.brutal=c() ??? ??? ??? ??? for(line in which(x$evnmt_brutal==1)){ ??? ??? ??? ??? ?? if(x$evnmt_brutal[line-1]==0){ ??? ??? ??? ??? ? vect.brutal=c(vect.brutal,line) ??? ???...
2013 May 02
3
R issue with unequal large data frames with multiple columns
I'm a bit of an amateur R programmer. I can do simple R scenarios but my handle on complex grammatical issues isn't steady. I have 12 CSV files that I've read into dataframes. Each has 8 columns and over 2000000 rows. Each dataframe has data associated by time component and a date component in the format of: X.DATE and then X.TIME X.DATE is in the format of MMDDYYYY and X.TIME is
2013 Jun 30
0
Help: argument is not numeric or logical: returning NA
...t one having different dimensions.? I think it was based on `summarized`. Then, the second problem I encountered for testing is that the dataset you provided doesn't fulfill the criteria. lst1<- list(structure(list......) #output of dput ? lst2<- lst1[1:10] #deleted the last list element lst3<-lapply(lst2,function(x) {x$V3<- as.character(x$V3);x})? #here if I apply one of the conditions, none of the list elements fulfill the criteria #for example lapply(lst3,function(x) subset(x,V1==6 & V6>300 & V6<3000,select="V6")) #[1]] #[1] V6 #<0 rows> (or 0-le...
2013 Feb 28
11
new question
Hi, directory<- "/home/arunksa111/data.new" #first function filelist<-function(directory,number,list1){ setwd(directory) filelist1<-dir(directory) direct<-dir(directory,pattern = paste("MSMS_",number,"PepInfo.txt",sep=""), full.names = FALSE, recursive = TRUE) list1<-lapply(direct, function(x) read.table(x,header=TRUE, sep =