search for: lst1

Displaying 20 results from an estimated 65 matches for "lst1".

Did you mean: lst
2007 Jul 18
1
Neuman-Keuls
hello, I have programmed this function to calculate the Neuman-Keuls test but I have a problem the function return an empty list and I don't know why. summary(fm1) E <- sqrt((summary(fm1)[[1]]["Residuals","Mean Sq"])/length(LR)) lst <- list() lst1 <- list() lst2 <- list() NK <- function (x) { if (length(x) == 2) { Tstudent <- t.test(subset(exple, groupe == names(x)[1])$vd,subset(exple, groupe == names(x)[2])$vd) t <- as.numeric(Tstudent$statistic) if (t >= Tstudent$conf.int[1:2][1] & t <= Tstudent$conf.int[1:...
2013 Apr 25
2
Selecting and then joining data blocks
Hi all, I have 4 matrices, each having 5 columns and 4 rows .....denoted by B1,B2,B3,B4. I have generated a vector of 7 indices, say (1,2,4,3,2,3,1} which refers to the index of the matrices to be chosen and then appended one on the top of the next: like, in this case, I wish to have the following mega matrix: B1over B2 over B4 over B3 over B2 over B3 over B1. 1> How can I achieve this?
2007 Feb 08
5
remove component from list or data frame
...e say you have: lst<-c(5,6,7,8,9) How do you remove, for example, the third component in the list? lst[[3]]]<-NULL generates an error: "Error: more elements supplied than there are to replace" Also, how do you remove a row from a data frame? For example, say you have: lst1<-c(1,2,3,4,5) lst2<-c(6,7,8,9,10) frame<-data.frame(lst1,lst2) How do you remove, for example, the second row of frame? Thanks, - Jason
2012 Jan 11
3
turning a list of vectors into a data.frame (as rows of the DF)?
...of uneual length) inot a dataframe.  Each vector held in the list represents a row, and there are some rows of unequal length.  I would like NAs as placeholders for "missing" data in the shorter vectors.  I think I'm missing something quite basic.   v1 <- c(1,2,3,4) v2 <- c(1,2) lst1 <- list(v1,v2)   Of course there is the intuitive:   as.data.frame(lst1)   However, the recycling rule (expectedly) reclycles 1,2 versus using NAs as placeholders.   Then, looking into Teetor's R Cookbook, there is a piece of code that looked (from the description) like it might do the trick...
2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2013 Aug 25
1
Capturing the whole output using R
Hi, May be this helps: #Creating some dummy data.? set.seed(24) lst1<-lapply(1:8,function(x) ts(sample(1:25,20,replace=TRUE))) set.seed(49) lst2<-lapply(1:8,function(x) ts(sample(1:45,20,replace=TRUE))) ??Find_Max_CCF() #No vignettes or demos or help files found with alias or concept or #title matching ?Find_Max_CCF? using regular expression matching. Foun...
2004 Jul 06
2
lme: extract variance estimate
...store it in a vector. If I do a print() or summary() on the model, the number I need is displayed in the Console [it's the 0.1590195 in the output below] >print(fit) >Linear mixed-effects model fit by maximum likelihood > Data: datag2 > Log-likelihood: -145.0028 > Fixed: lst1 ~ lst >(Intercept) lst > 1.1080629 0.7582595 > >Random effects: > Formula: ~1 | yeart > (Intercept) Residual >StdDev: 0.1590195 0.3313497 However I have not been able to find that number anywhere in the model object returned by lme. Can anyone tell me...
2013 Aug 24
1
Divide the data into sub data on a particular condition
Hi, Use ?split() #dat1 is the dataset: lst1<- split(dat1,dat1$BaseProd) lst1 #$`2231` ?# BaseProd? CF OSA #1???? 2231 0.5 0.7 #2???? 2231 0.8 0.6 #3???? 2231 0.4 0.8 # #$`2232` ?# BaseProd CF OSA #4???? 2232? 1?? 2 #5???? 2232? 3?? 1 # #$`2233` ?# BaseProd? CF OSA #6???? 2233 0.9 0.5 #7???? 2233 0.7 0.5 #8???? 2233 4.0 5.0 #9???? 2233 5.0...
2013 Apr 24
2
Distance matrices Combinations
Dear UseRs, MY PROBLEM IS A SMALL PIECE OF A REAL BIG AND A COMPLICATED PROBLEM. IF I DELIBERATE IN A VERY SIMPLE WAY THEN ALL I WANT IS TO PUT ALL THE POSSIBLE COMBINATIONS OF 75 DISTANCE MATRICES (BY TAKING 4 MATRICES, MORE COMMONLY 75C4), in the following equation. t<-as.matrix((MAT1)^2+(MAT2)^2+(MAT3)^2+(MAT4)^2+,upper=T,diag=T)) Then "1215450" values of "t"(one for
2011 Sep 03
3
Saving a list as a Matrix
Hi there. I went through the manual but I couldn't find a solution for my problem. I have list like this one : > lst1 [[1]] [1] 0 1 2 3 [[2]] [1] 0 1 5 [[3]] [1] 2 3 4 and I want to save it as Matrix in Matlab mat format like : 0 1 2 3 0 1 5 0 2 3 4 0 can any body help me ? Appreciate your help and thanks in advance. Reza -- View this message in context: http://r.789695.n4.nabble.com/Saving-a-list-as-a-Mat...
2008 Oct 01
3
lapply where each list object has multiple parts
...in the list has multiple parts. I'd like to take the mean of just one part of each object. Is it possible to do this with lapply? If not, can you recommend another function? Thanks. eric > x1 <- c(0,1,2,3) > x2 <- c(7,8) > x3 <- c(2,6,6,8) > x4 <- c(4,8) > > Lst1 <- list(label1 = x1,label2 = x2) > Lst2 <- list(label1 = x3, label2 = x4) > > BigList <- list(Lst1, Lst2) > > lapply(BigList$label1, mean) list() > [[alternative HTML version deleted]]
2013 Apr 10
6
means in tables
Hi. I have 2 tables, with same dimensions (8000 x 5). Something like: tab1: V1 V2 V3 V4 V5 14.23 1.71 2.43 15.6 127 13.20 1.78 2.14 11.2 100 13.16 2.36 2.67 18.6 101 14.37 1.95 2.50 16.8 113 13.24 2.59 2.87 21.0 118 tab2: V1 V2 V3 V4 V5 1.23 1.1 2.3 1.6 17 1.20 1.8 2.4 1.2 10 1.16 2.6 2.7 1.6 11 1.37 1.5 2.0 1.8 13 1.24 2.9 2.7 2.0 18 I need generate a table of averages, the
2013 Nov 05
0
Sampling question
...7L)), .Names = c("SubID", "CSE1", "CSE2", "CSE3", "CSE4", "WSE1", "WSE2", "WSE3", "WSE4" ), class = "data.frame", row.names = c(NA, -8L)) fun1 <- function(dat, rep){ res <- replicate(rep,{ ?lst1 <-lapply(sample(nrow(dat),nrow(dat)),function(x) sample(dat[x,2:5],4)) names(lst1) <- sapply(lst1,row.names) lst1[-c(1:2)] <- lapply(names(lst1)[-c(1:2)],function(i) { ??? ??? ??? x1 <- dat[i,6:9][is.na(match(gsub("^.","",names(dat[i,6:9])),gsub("^.",&quot...
2013 May 22
0
calcul of the mean in a period of time
...??????????? 0???????????????? 1.2 4?????????????????????? 0???????????????? 1.3 4?????????????????????? 1???????????????? 1.8 ",sep="",header=TRUE) library(plyr) ?dat2New<-ddply(dat2,.(patient_id),summarize,t=seq(min(t),max(t))) ?res<-join(dat2New,dat2,type="full") ?lst1<-lapply(split(res,res$patient_id),function(x) {x1<-x[x$t!=0,];do.call(rbind,lapply(split(x1,((x1$t-1)%/%3)+1),function(y) {y1<-if(any(y$t==1)) rbind(x[x$t==0,],y) else y; data.frame(patient_id=unique(y1$patient_id),t=head(y1$t,1),scores=mean(y1$scores,na.rm=TRUE))}) ) }) lst1[lapply(lst1,...
2013 Sep 27
3
Compare species presence and absence between sites
Dear List, I want to compare the presence and absence of bird species based on the sites in a matrix. The matrix has 5 rows for Island A, B, C, D, and E. It has 100 columns for bird species D001-D100. In each cell of the matrix, the presence-absence of bird species will be recorded as 1 or 0. (For example, if species D001 is found on Island D, the matrix cell of species D001 and Island D
2009 Sep 29
1
Comparing vectors from lists
Hi guys, I still did not solve my problem properly! I have to compare the values of two lists of 250 numbers as a result of using the ?by function! List1 of 250  $ 0   : num [1:28] 22 11 31...  $ 1   : num [1:15] 12 14 9 ... .. .. ..  - attr(*, "dim")= int 250  - attr(*, "dimnames")=List of 1 List2 of 250  $ 0   : num [1:24] 20 12 22...  $ 1   : num [1:17] 11 12 19 ... .. ..
2006 Jul 26
1
.Call question
Writing R Ext says to treat R objects that are arguments to .Call as read only (i.e. don't modify). I have a long list of lists that and I want to avoid the overhead of a copy in my C code. I would just like to modify some of the elements of list by replacing them with elements of exactly the same size/type. below is an example of the essence of the problem. This seems to work. Is this
2013 Jun 08
0
data
...the #condition that the absolute difference between the dimensions of those rows and the first row dimension was minimum (after I applied the first #constraint).? I guess you wanted 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...
2013 Aug 27
1
[plyr] Moving average filter with plyr
Dear all, I'm stuck with a problem using plyr to process a rather large junk of data. What I'm trying to do is applying a moving average to all the subparts of the dataframe (the example data can be found here https://dl.dropboxusercontent.com/u/2414056/testData.Rdata). require(plyr) load("testData.Rdata") applyfilter<-function(x){ return(filter(x,rep(1/5, times=5))) }
2013 Sep 20
3
search species with all absence in a presence-absence matrix
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I would like to search the species with absence (0) in all the islands (Island A to Island O.)