Displaying 20 results from an estimated 1000 matches similar to: "How to find frequent sequences."
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
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example 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,
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,
2012 Jan 11
3
turning a list of vectors into a data.frame (as rows of the DF)?
As a newer R practicioner, it seems I stump myself weekly (at least) with issues that have spinning my wheels. Here is yet another... I'm trying to turn a list of numeric vectors (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.
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 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 07
2
finding events in a time duration.
Hi,
Premises: I have a database which contain the list of events and their time
stamps (This is a Unix time stamps)
What I want to do : I want know how much is the maximum occurrence of this
in any a time period of 7 days or does a event occur es more than "N" (say
5) times in a period of 7 days.
This time period is not fixed with "week
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
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:
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 7.0
lst1[[1]]
#? BaseProd? CF OSA
#1???? 2231 0.5 0.7
2008 Oct 01
3
lapply where each list object has multiple parts
Hi. I have a list where each object 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 <-
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
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.
Found a function with the same
2004 Jul 06
2
lme: extract variance estimate
For a Monte Carlo study I need to extract from an lme model
the estimated standard deviation of a random effect
and 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:
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 ...
..
..
2005 Jan 07
2
[LLVMdev] Primer with LLVM
Really JIT isn't my goal. I prefer use a native execution engine; and ok, I
don't need save the generated Module so it ever lives in memory, so if LLVM
doesn't generate relocatable code it's fine for me.
About the reentrant lacks of LLVM, I can convert my own code - which build
the Module - into a critical section so I think it is enough; but I need to
know if several independent
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 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.)
2013 Apr 18
6
count each answer category in each column
Hey,
Is it possible that R can calculate each options under each column and
return a summary table?
Suppose I have a table like this:
Gender Age Rate
Female 0-10 Good
Male 0-10 Good
Female 11-20 Bad
Male 11-20 Bad
Male >20 N/A
I want to have a summary table including the information that how many
answers in each category, sth like this:
X