Displaying 20 results from an estimated 10000 matches similar to: "request: most repeated component of a list"
2008 Oct 15
3
request: How can we ignore a component of list having no element
Dear friends
There is a list of arrays comprising different no of rows and columns even sometimes NULL, such as [[2]] given below. How can we ignore [[2]] or others like this in the complete list. Any help in this regard is needed. Thanks
[[1]]
[,1] [,2]
[1,] 3 1
[2,] 3 1
[3,] 3 1
[[2]]
NULL
[[3]]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 3 1
2008 Sep 06
2
request: most repeated sequnce
Dear R community
Hope every one be in best of his/her health. I have a situation in which there are s-sectors. Each sector is further divided into r-rows and c-columns. All it makes an array having dimension (r,c,s). e.g.
x=c(1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,3,4,4,4,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,
2008 Oct 14
4
request: How to ignore columns having zero sums
Dear friends
I have an array consist of r-rows and c-columns e.g.
x=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,0,0,0,0,0,0,0,0);
x1=array(x, dim=c(4,6))
output is
> x1
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1 2 3 4 0 0
[2,] 1 2 3 4 0 0
[3,] 1 2 3 4 0 0
[4,] 1 2 3 4 0 0
How can i ignore columns having zero sums? Help in this regard
2008 Sep 03
2
request: How to get column name
Dear R community
I have a problem regarding which of the column in a matrix contains all of zero elements. e.g.
x=c(3,3,3,3,0,0,0,0,5,5,5,5,8,8,8,8); x=matrix(x, nrow=4)
the output is
> x
[,1] [,2] [,3] [,4]
[1,] 3 0 5 8
[2,] 3 0 5 8
[3,] 3 0 5 8
[4,] 3 0 5 8
In this case the required column is second so the result should be "2".
2008 May 28
3
request: which integer in each column is in majority
Respected R helpers/ users
I am one of the new R user. I have a problem regarding to know which of the integer in each column of the following matrix is in majority. I want to know that integer e.g. in the first column 1 is in majority. Similarly in the third column 4 is in majority. So what is the suitable way to get the desired integer for each column. I am looking for some kind reply. Thanks
2008 Jun 03
1
request: An array declarion problem
Dear R users
I tried a lot to solve the following problem but could not. I have two arrays having same order i.e 1 by 150.
j=10; ss=150; r=array(0 , c( j , ss )); rr=array(0 , c( j , ss )); r1=array(0 , c( j-1 , ss )); r2=array(0 , c( j-1 , ss ));
r3=array(0 , c( 2 , ss ))
for(i in 1:j-1){
r1[ i , ] <- r[ j+1, ]-r[ j, ]; r2[ i , ] <- rr[ j+1, ]-rr[ j, ]
2008 Jun 27
1
request: To access a particular list
Dear R community
I have a problem to access particular list. I have a code given below where there is recursive process. It is not possible to run it because there are few other functions involved inside like sv, LN, RN etc.
k=0; n=0; variable=c(); vr<-list()
func <- function(data,testdata)
{
.
.
if(......){
n<<-n+1; vr[[n]] <<- variable; print(vr)
2008 Dec 01
1
request: how to assign alphabets to integer values
Dear R community
I am trying to assign alphabets to integer values 1, 2, 3 etc. in y given below. Can any body suggest some simple way to do the same job?
ds=iris; dl=nrow(ds)
c1=ds[,1]; c2=ds[,2]; c3=ds[,3]; c4=ds[,4]; c5=ds[,5]; iris=cbind(c1,c2,c3,c4,c5)
y=iris[,5]
y1=which(y==1); y[y1] <- c("a"); y2=which(y==2); y[y2] <- c("b"); y3=which(y==3); y[y3] <-
2008 Oct 24
1
Request: Most repeated sequence considering combinations at each row
Dear friends
Hope you all are fine. Suppose we have a list of arrays.
a1=c(4,4,4,4,0,4,4,4,0,3,3,0,0,0,0,0); a1=array(a1,dim=c(4,4)); a2=c(4,4,4,4,0,4,4,4,0,3,3,0,0,0,0,0); a2=array(a2,dim=c(4,4));
a3=c(4,4,4,4,0,3,3,4,0,4,4,0,0,0,0,0); a3=array(a3,dim=c(4,4)); a4=c(4,4,4,4,4,0,3,3,3,3,0,4,4,4,0,0,0,0,0,0); a4=array(a4,dim=c(5,4)); a5=c(4,4,4,4,4,0,4,4,4,4,0,3,3,3,0,0,1,1,0,0);
2008 Jun 06
5
request: a class having max frequency
Dear R users
I have a very basic question. I tried but could not find the required result. using
dat <- pima
f <- table(dat[,9])
> f
0 1
500 268
i want to find that class say "0" having maximum frequency i.e 500. I used
>which.max(f)
which provide
0
1
How can i get only the "0". Thanks and
best regards
Muhammad Azam
Ph.D. Student
Department of
2008 Jun 02
2
request: To add an extra row in a matrix
Dear R users
I have a problem regarding an addition of an extra "row" to a matrix. e.g. i have a matrix
a <- matrix(1:6,2,3)
> a
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
I want to add a matrix having just one row. e.g.
b <- matrix(7:9,1,3)
> b
[,1] [,2] [,3]
[1,] 7 8 9
Now i want to get result like this
[,1] [,2] [,3]
[1,] 1 3 5
2008 Sep 07
0
Fwd: request: most repeated sequnce
---------- Forwarded message ----------
From: jim holtman <jholtman at gmail.com>
Date: Sun, Sep 7, 2008 at 11:42 AM
Subject: Re: [R] request: most repeated sequnce
To: Muhammad Azam <mazam72 at yahoo.com>
This should do it for you:
> x=c(1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,3,4,4,4,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,
+
2009 Apr 09
1
request: maximum depth reached problem
Dear R community
Hope all of you are fine. I have a question regarding the an error message. Actually, I am trying to generate classification trees using "tree" package. It works well but for some datasets e.g., wine, yeast, boston housing etc. it gives an error message.
Error in tree(V14 ~ ., data = training.data, method = c("recursive.partitioning"), :
maximum
2009 Apr 01
1
Request: Optimum value of cost complexity parameter "k" in "tree" package
Dear R community
I have a question regarding the value of cost complexity parameter "k" used in "tree" package for pruning purpose. Any help in finding the optimum value of "k" is requested. Please give some suggestion in this regard. In the example below i used k=0 but i don't know why? But if i use k=NULL, then it will not plot the resultant tree.
2006 Aug 08
3
Pairwise n for large correlation tables?
Hello,
I'm using a very large data set (n > 100,000 for 7 columns), for which I'm
pretty happy dealing with pairwise-deleted correlations to populate my
correlation table. E.g.,
a <- cor(cbind(col1, col2, col3),use="pairwise.complete.obs")
...however, I am interested in the number of cases used to compute each
cell of the correlation table. I am unable to find such a
2009 Mar 26
1
loop problem
Dear R members
I have a problem regarding storing the lists.
Let
L=number of distinct values of any predictor (say L=5)
P=number of predictors (say P=20)
g1 <- c()
for(i in 1:P){
if(L > 1){
for(j in 1:(L-1)){
g <- ....
g1[j] <- g
}
}
g2[]=sort.list(g1)
}
Now the question is: What should we use inside brackets of g2[....], whether
2008 Oct 30
2
request: How to combine three matrices in the desired form
Dear R-friends
I have three matrices e.g. var <- matrix(c(4,4,4,4,0,4,4,4,0,3,3,0),nrow=4); val <- matrix(c(0.6,0.6,0.6,0.6,0,1.6,1.6,1.6,0,4.9,4.9,0),nrow=4); nod <- matrix(c(-1,-1,1,1),ncol=1)
> var
[,1] [,2] [,3]
[1,] 4 0 0
[2,] 4 4 3
[3,] 4 4 3
[4,] 4 4 0
> val
[,1] [,2] [,3]
[1,] 0.6 0.0 0.0
[2,] 0.6 1.6 4.9
[3,] 0.6 1.6
2012 Jan 27
1
repeat function for entire list of matrices
hi all.
perhaps someone can help me with subsetting here............
i'm trying to use the nested() function in the bipartite package. my
problem is that i have a list of 10,000 matrices and i want the output to be
a vector of the nested() function on each of the 10,000 matrices (so i can
use these numbers in a statistical test).
here is what i'm working with currently:
#to store
2009 Jun 06
2
A very frustrating read.table error message
Dear Colleagues,
Occasionally I deal with computer-generated (i.e., websurvey) data
files that haven't quite worked correctly. When I try to read the data into
R, I get something like this:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
line 26 did not have 648 elements
...is there any way to get R to tell me how many elements line 26 *did*
have? That
2006 Aug 09
3
categorical data
Dear List,
I neeed a grouped list with two sort of categorical data. I have a data
.frame like this.
year cat. b c
1 2006 a1 125 212
2 2006 a2 256 212
3 2005 a1 14 12
4 2004 a3 565 123
5 2004 a2 156 789
6 2005 a1 1 456
7 2003 a2 786 123
8 2003 a1 421 569
9 2002 a2 425 245
I need a list with the sum of b and c for every year and every cat (a1,
a2 or a3) in this year. I had used the tapply