Displaying 20 results from an estimated 7000 matches similar to: "comparing matrices using max or min"
2009 May 16
3
How to save R "clean" sessions in BATCH mode?
Thanks a lot for all of you that have reply me about opening and
ending R workspaces in BATCH mode. However replies were a king general
and I?m afraid I could not take the entire message from them.
Therefore I chose to expose here a representative fraction of my work.
I have 50 Rdata files (F1,F2,F3,F4,
,F50) with objects inside.
I need to:
open F1:
- perform some simple operations
2008 Mar 02
1
an efficient pairwise matrix cell's comparison function
To all,
I am undergoing an analysis involving big matrices of about 30000x200 which
I have to handle in a more efficient way. So I would like some advice to
build such efficient function to deliver the following result:
- starting with 2 matrices of the same dimension (eg. A and B)
0 0 3 5 6 0 0 5
A= 0 0 6 4 B= 0 4 3 5
2009 Apr 03
2
Basic doubts on the use of several script files in R batch mode
I already searched for information regarding the batch file operations
within R. But I could not locate the information I need.
Basically I have a doubt regarding the procedures on the batch use of
several script files (*.R).
How can I do this?
How can I define the order of files?
My intention is to programme openings, math operations and savings of
*.Rdata sessions, but in a sequential
2008 Aug 21
1
[dist]how to analise a large matrix?
Hi all,
I have a matrix of about 100.000?x 4?that I need?to classify using
euclidean metric. For that I am using dist?or daisy functions, but I
am afraid that the message: Error in vector("double", length) : vector
size specified is too large, means too much lines.
Can anyone suggest me how should I analyse this matrix?
Thanks in advance,
Diogo Andr? Alagador
MNCN,CSIC, Madrid, Spain
2008 Oct 31
4
[ifelse] how to maintain a value from original matrix without probs?
Dear all,
I have a matrix with positive and negative values.
>From this I would like to produce 2 matrices:
1st - retaining positives and putting NA in other positions
2nd - retaining negatives and putting NA in other positions
and then apply rowMeans for both.
I am trying to use the function ifelse in the exemplified form:
ifelse(A>0,A,NA)
but by putting A as a 2nd parameter it
2008 Mar 27
2
colMeans in a data.frame with numeric and character data
Hi all,
I would like to know if it is posible by, someway, to get colMeans from
a data.frame with numeric as well as character data, dispersed all over
the object. Note that I would like to get colMeans neglecting character
data.
I am really in need of some function proceeding in that way…
All the best
Diogo André Alagador
[[alternative HTML version deleted]]
2007 Oct 22
3
median value dataframe coming from multiple dataframes
Hi all,
I am not a skillful R programmer and has I am handling with large dataframes (about 30000 x 300) I am in need of an efficient function.
I have 4 dataframes with the same dimension. I need to generate other dataframe with the some dimension than the others where in each position it has the median value of the 4 values in the same position coming from the 4 dataframes.
Grateful by your
2007 Nov 06
2
wilcox test on two data frames
Hi all,
Basically I have 2 data frames with equal dimension and I want to apply the wilcox.test to compare columns in the same position (i.e. 1st of df.A with 1st of df.B, 2nd of df.A with 2nd of df.B,...).
Anyone give me an hint on this, as I think it is nicer to avoid loops, specially for huge dataframes (30000 x 200)
Thanks in advance,
Diogo André Alagador
Portugal
[[alternative HTML
2007 Jul 20
3
R CMD SHLIB problem [make: *** No rule to make target ]
Hy all,
I apologize for my ingenuity in regard to interfaces in R, but I do need it for my work. In that respect I took a simple and small example from the net (the "hello world", one) to interface R with C.
I have a Windows XP OS using R.2.5.0 and in that regard I have installed the Perl and RTools files to my PC. I also wrote a proper path file, as suggested.
The C program is:
2007 Jul 20
1
Column-mean-values for targeted rows
Hi all,
I'm handling massive data.frames and matrices in R (30000 x 400).
In the 1st column, say, I have 0s and 1s indicating rows that matter; other columns have probability values.
One simple task I would like to do would be to get the column mean values for signaled rows (the ones with 1)
As a very fresh "programmer" I have build a simple function in R which should not be very
2008 Apr 27
1
parallel max, min, and median of dataframe columns
Hello, all,
I have a dataframe of three rows and umpteen columns. I want to show the
maximum, minimum, and median with a vertical line and a central dot (I'd
use a boxplot, but with only three data points, that's overkill; I can't
just use points, because of overlap and some of the other data plotted on
the graph).
This works:
> boxplot(data_frame,
2009 Jul 24
2
How to find the min and max of two variables in a data frame
I have two variables in a data frame, I want to generate two additional
variables. For every observations (i.e. every row), I want the first new
variable 'min' to carry the minimum of the two existing variables, and I
want the second new variable 'max' to carry the maximum of the two existing
variables. I then want to sort the data frame by min and max, and delete
duplicated rows
2010 Nov 25
4
Cumsum with a max and min value
I have a vector of values -1, 0, 1, say
a <- c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1)
I want to create a vector of the cumulative sum of this, but I need to set a
maximum and minimum value for the cumsum, for example:
max_value <- 2
min_value <- -2
the expected result would be (0, 1, 1, 2, 2, 1, 0, -1, -1, -2, -2)
The only way I managed to do It, was
res <-
2012 Mar 08
4
Correlation between 2 matrices but with subset of variables
Dear All,
I have two matrices A (40 x 732) and B (40 x 1230) and would like to calculate correlation between them. I can use: cor(A,B, method="pearson") to calculate correlation between all possible pairs. But the issue is that there is one-many specific mappings between A and B and I just need to calculate correlations for those pairs (not all). Some variables in A (proteins, say p1)
2010 Nov 17
2
slicing list with matrices
A list contains several matrices. Over all matrices (list elements) I'd like to access one matrix cell:
m <- matrix(1:9, nrow=3, dimnames=list(LETTERS[1:3], letters[1:3]))
l <- list(m1=m, m2=m*2, m3=m*3)
l[[3]] # works
l[[3]][1:2, ] # works
l[[1:3]][1, 1] # does not work
How can I slice all C-c combinations in the list?
S?ren
--
S?ren Vogel, Dipl.-Psych. (Univ.), PhD-Student, Eawag,
2010 Apr 17
2
Please help with min()
Hello,
I have two vectors of length = 10
x<-c(2,14,79,27,3,126,15,1,12,4)
y<-rep(4,10)
and I would like to create a third vector of length = 10 that contains the
smallest value at each position in the two above vectors.
I have tried:
z<-min(x,y)
but that doesn't work.
With the example data above, the third vector would look like this.
> z
[1] 2 4 4 4 3 4 4 1 4
2011 Jan 03
3
matrices call a function element-wise
Hello
I have 4 1000*1000 matrix A,B,C,D. I want to use the corresponding element of the 4 matrices. Using the "for loop" as follow:
E<-o
for (i in 1:1000)
{for (j in 1:1000)
{
E<-fisher.test(matrix(c(A[i][j],B[i][j],C[i][j],D[i][j]),2))#call fisher.test for every element
}
}
It is so time-consuming
Need vectorization
Yours sincerely
ZhaoXing
Department of
2011 Dec 12
0
Rsolnp package: warning messages
Dear,
I am using the solnp command (package Rsolnp) for a problem with
equality and inequality constraints.
I am not getting convergence for my problem but apart that I get 1
warning per iteration saying: ?In cbind(temp, funv) : number of rows
of result is not a multiple of vector length (arg 1)?.
I checked for equality and inequality functions and they seem fine to
me. Where this
2006 Jul 06
3
Comparing two matrices
hi:
I have matrix with dimensions(200 X 20,000). I have
another file, a tab-delim file where first column
variables are row names and second column variables
are column names.
For instance:
> tmat
Apple Orange Mango Grape Star
A 0 0 0 0 0
O 0 0 0 0 0
M 0 0 0 0 0
G 0 0 0 0 0
S 0 0 0 0 0
2006 Dec 22
1
Base R: applying min/max functions() to character string vectors (PR#9428)
Full_Name: Xiao Gang FAN
Version: 2.4.0
OS: Windows XP
Submission from: (NULL) (159.50.101.9)
Dear All,
This is not really a bug report, but rather a change wish to the Base R
behaviour
on some functions when applying them to character strings vectors/matrices.
Actually in R, we can do thinks like, the most naturally way in this the world:
> "a" < "b"
[1] TRUE
>