similar to: Assign Formulas to Arrays or Matrices?

Displaying 20 results from an estimated 10000 matches similar to: "Assign Formulas to Arrays or Matrices?"

2005 Sep 28
3
is it possible to form matrix of matrices...and multiple arrays
Dear sirs, 1...........Kindly tell me is it possible to form a matrix which contains a no of matrices.. for eg.. if a,b,c,d are matrices.... and e is a matrix which contains a,b,c,d as rows and columns.. 2..........Is it possible to form array of array of arrays for eg.. "A" contains two set of arrays (1,2)...and each A[1] and A[2] individually contains two set of arrays I tried like
2011 Mar 08
1
repeat matrix column within each array third dimension
Hello all, I'm working with a matrix that will have varying dimensions. It will populate an array such that the number of matrix columns will determine the number of 3rd dimension levels of the array. Rows will be the same for both. For this example lets say the array will have 2 columns, but that's not fixed. dim(arr)<-c(dim(mat)[1],2,dim(mat)[2]) I wish to repeat each matrix
2005 Mar 16
8
Summing up matrices in a list
Dear all, I think that my question is very simple but I failed to solve it. I have a list which elements are matrices like this: >mylist [[1]] [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 [[2]] [,1] [,2] [,3] [1,] 7 9 11 [2,] 8 10 12 I'd like to create a matrix M<-mylist[[1]]+mylist[[2]] [,1] [,2] [,3] [1,] 8 12 16 [2,] 10 14 18
2003 Apr 02
7
Index of item in matrix
Hello All, Is there a fast way to find the index(row and column) of a point in a matrix? Thanks, John. -- -------------------------------------------------------------------------- Dr. John Janmaat Department of Economics, Acadia University, Wolfville, NS, B4P 2R6 E-mail: jjanmaat at acadiau.ca Web: http://ace.acadiau.ca/~jjanmaat Tel: 902-585-1461 Fax: 902-585-1070
2010 Mar 18
2
how to take multiple subsets from a matrix
useR's I have a matrix from which I want to take multiple subsets from, according to a particular scheme I will now describe. The matrix below (mat) is 5x5, and I want to take 9 subsets of it, each of dimension 3x3. The best way to explain what the result should look like is with the following: > dat <- c(3,6,1,9,12,9,2,10,6,5,3,13,1,4,8,9,4,6,10,11,2,7,3,5,10) > miss <-
2011 Dec 04
4
equating approximate values
Hello List, I am having trouble finding the command for my problem. I have two arrays x and y. now i would like to compare the values of x and y and then get the index of x which is exactly or approximately equal(+/- some value ) to the values in y. x <- runif(100,min=0,max=5) y <- runif(10,min=0,max=5) the threshold value(+/-) value can vary. for this example lets take it to be .5
2006 Dec 10
4
sample "n" random positions from a matrix
Hi there, I have a binary matrix (dim 100x100) filled with values 0 and 1. I need select a record "n" positions of that matrix when values are 1. How can I do that? Thanks for all, Miltinho Brazil --------------------------------- [[alternative HTML version deleted]]
2004 Sep 27
8
cannot assign dimnames
Dear list, If anyone knows how to assign dimnames to matrices or arrays I would be most grateful for help. I've tried various permutations of likely-looking code but get error messages every time. I could find no example in the documentation. Many thanks, Dan Bebber Department of Plant Sciences University of Oxford South Parks Road Oxford OX1 3RB UK Tel. 01865 275000
2006 Feb 14
3
Inf values in a matrix
Hello, I have some Inf values in a matrix, but I don't want to replace them with some value but rather remove the rows that contain the Inf values. Also I would like to record the rows which were removed. Is there an easy way to do this instead of writing loops over the matrix? Thanks. Ita Cirovic Donev
2010 Oct 08
3
Efficiency Question - Nested lapply or nested for loop
My data looks like this: > data name G_hat_0_0 G_hat_1_0 G_hat_2_0 G_0 G_hat_0_1 G_hat_1_1 G_hat_2_1 G_1 1 rs0 0.488000 0.448625 0.063375 1 0.480875 0.454500 0.064625 1 2 rs1 0.002375 0.955375 0.042250 1 0.000000 0.062875 0.937125 2 3 rs2 0.050375 0.835875 0.113750 1 0.877250 0.115875 0.006875 0 4 rs3 0.000000 0.074750 0.925250 2 0.897750 0.102000
2009 Mar 25
1
Weighted Graph Link strength ( I am making mistake please help)
Hello R experts, I went through R mailing,Nabble R.I could not find solution.Can someone help me. I have undirected Graph. Here is an example of spreadsheet I have( Unique 3559 Nodes) snippet of 4 rows. Node1 Node2 Weights 1 2 5 2 3 30 2 4 30 1 4 5 3 4 30 1 3 2 I created a program reading the csv and created a Adjacency matrix.From the adjacency matrix I created graph.I am not sure the
2009 Sep 10
2
index of min elements in matrix
Hi, All, How can I get the indices of the minimum elements in a matrix without using a loop? For example, if the matrix is 4 5 2 2 8 9 5 2 3 Then I want to output (1,3), (2,1), (3,2). Thanks, Annie [[alternative HTML version deleted]]
2011 Mar 19
3
create a matrix with values from data.frame
Hello, I'm trying to create a matrix (95x55) with data from a data.frame pop: xloc yloc go ind Ene totW 1 23 20 516 1 0.02 20.21 2 23 20 1143 1 0.02 20.21 3 23 20 250 1 0.02 20.21 4 22 15 251 1 0.02 18.69 5 22 15 598 1 0.02 18.69 6 21 19 250 1 0.02 20.21 7 22 20 251 1
2004 Aug 25
6
R-help
Dear R users, I have just start working with R and would need some help. If you have a matrix as: [,1] [,2] [,3] [1,] 11 24 11 [2,] 16 29 16 [3,] 2 15 2 and you want the position where you can find the maximum value, in this case row 2 and column 2. How could you get the position? The values in the matrix is likelihood function values, and each row and
2012 Jun 19
2
how to use by function
hi all, Assume I have data like data<-rbind(c(1,2),c(1,3),c(2,1),c(3,2),c(3,4)) I want to get some matrix like 1,2,3 2,NA,NA 3,2,4 I'm using by mat<-matrix(NA,3,3) by(data,data[,1],mat[data[,1],]<-c(data[,2])) but it doesn't work. Any ideas? thanks, cowboy
2006 Mar 07
3
returning the largest element in an array/matrix?
Hi all, I want to use "which.max" to identify the maximum in a 2D array/matrix and I want "argmin" and return the row and column indices. But "which.max" only works for vector... Is there any convinient way to solve this problem? Thanks a lot! [[alternative HTML version deleted]]
2006 Nov 03
3
identify extremes positions of values into matrix
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20061103/39e6883b/attachment.pl
2003 Mar 19
2
Time Series-like barplot?
I have data structured like the following: > foo.mat <- matrix(NA, ncol = 5, nrow = 10) > foo.mat[2:6,1] <- 1 > foo.mat[1:3,2] <- 1 > foo.mat[3:10,3] <- 1 > foo.mat[1:10,4] <- 1 > foo.mat[8:10,5] <- 1 > foo.mat [,1] [,2] [,3] [,4] [,5] [1,] NA 1 NA 1 NA [2,] 1 1 NA 1 NA [3,] 1 1 1 1 NA [4,] 1 NA 1 1
2008 Dec 02
4
Variables inside a for
Hi! I had a database with some variables in sequence. Let me say: TX01, TX02, TX03 and TX04. But I need to run some regressions changing the variables... so: variable <- paste("TX0", 1:4, sep="") for(i in 1:4){ test[i] <- lm(variable[i] ~ INCOME, data=database) } But doesn't work... lm tries to find a variable inside database named variable[i] ... Suggestions?
2005 Feb 21
5
Compare rows of two matrices
Hello, #I have two matrices, eg.: y <- matrix( c(20, NA, NA, 45, 50, 19, 32, 101, 10, 22, NA, NA, 80, 49, 61, 190), ncol=4 ) x <- matrix( c(20, NA, NA, NA, 50, 19, 32, 101, 10, 22, NA, NA, 80, 49, 61, 190), ncol=4 ) #Whereas x contains all NA?s from y plus some additional NA?s. #I want to find the index of these additional NA?s. I think, there must be a very