similar to: median between matrix column

Displaying 20 results from an estimated 1000 matches similar to: "median between matrix column"

2012 Oct 05
3
loop for column substraction of a matrix
Dear useRs, I have a matrix with 38 columns and 365 rows. what i want to do is the following..... 1. subtracting from each column, first itself and then all the remaining columns. More precisely, from column number 1, i will first subtract itself(column 1) and then the remaining 37 columns. Afterwards i will take column number 2 and do the same. In this way i want to proceed till 38th column.
2012 Nov 27
3
loop command to matrix
Dear UseRs,Extremely sorry for a basic question. I have a matrix of 19 rows and 365 columns. what i want to do is the following...First i want to leave out column number 1 and want to calculate the row wise mean of the remaining columns, which will obviously give me 365 values in one column, and then subtracting these values from the column i left out i.e. col=1 then i want to leave out column 2
2012 Dec 25
2
for loop not working
dear R family,i have a matrix of 444 columns. what i want to do is the following. 1. starting from column 1 i want to select every 37th column on the way. more precisely i want to select column 1, 38,75,112,149 and so on. 2.starting from column 2, i again want to select every 37th column. which means 2,39,76,113,150 and so on. similarly starting from 3 till 37th column. i have tried following loop
2013 Apr 15
3
Indices of lowest values in matrix
Dear R users,Sorry for such a basic question. I really need to know that how can i pick the indices of 5 lowest values from each row of a matrix with dimensions 12*12??Thank you very much in advance Elisa [[alternative HTML version deleted]]
2013 Jan 10
1
merging command
HI Eliza, You could do this: set.seed(15) mat1<-matrix(sample(1:800,124*12,replace=TRUE),nrow=12) # smaller dataset #Your codes ?list1<-list() ?for(i in 1:ncol(mat1)){ ? list1[[i]]<-t(apply(mat1,1,function(x) x[i]-x)) ? list1} ?x<-list1?? x<-matrix(unlist(x),nrow=12) x<-abs(x) ?y<-colSums(x, na.rm=FALSE) z<-matrix(y,ncol=10) ?z<-as.dist(z) ?z ?# ?? 1?? 2?? 3?? 4?? 5??
2013 Feb 13
3
date and matrices
Hi Elisa, Try this: date1<-format(seq.Date(as.Date("1991.1.1",format="%Y.%m.%d"),as.Date("1996.12.31",format="%Y.%m.%d"),by="day"),"%Y.%m.%d") ?length(date1) #[1] 2192 mat1<-matrix(c(.314,.314,.273,.273,.236,.236,.236,.236,.273,.314,.403,.314),ncol=1) res1<-
2013 Jan 31
1
lower corner cumulative probability
Dear useRs, With the following set of command i managed to create the copula density ================================================ >library(MASS) >library(evd) >X<-matrix(sample(1:3000), ncol=2) >U=cbind(rank(X[,1])/(nrow(X)+1),rank(X[,2])/(nrow(X)+1)) > mat1=kde2d(U[,1],U[,2],n=150) image(mat1$x,mat1$y,mat1$z,col= rev(heat.colors(1500)),xlab="",ylab="")
2013 Mar 06
3
combining column having same values
Dear useRs, I have a matrix in the following form [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] 1 1 3 2 3 1 1 2 3 3 2 and following is my desired output (combining the column headers, having same values). a<-1,2,6,7 b<-3,5,9,10 c<-4,8,11 Thanks in advance Elisa [[alternative HTML
2013 Feb 27
2
matrix multiplication
Hi, Try this: #mat1 is the data res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2013 Feb 19
1
data format
Hi, Try this: el<- read.csv("el.csv",header=TRUE,sep="\t",stringsAsFactors=FALSE) ?elsplit<- split(el,el$st) ? datetrial<-data.frame(date1=seq.Date(as.Date("1930.1.1",format="%Y.%m.%d"),as.Date("2010.12.31",format="%Y.%m.%d"),by="day")) elsplit1<- lapply(elsplit,function(x)
2013 Jan 03
5
splitting matrices
Dear useRs, i want to split a matrix having 1116rows and 12 columns. i want to split that matrix into 36 small matrices each having 12 columns and 31 rows. The big matrix should be splitted row wise. which means that the first small matrix should copy values which are in first 31 rows and 12 columns of the big matrix. similarly 2nd small matrix should contain values from 32nd to 63rd row of the
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
2012 Sep 21
2
efficient overlapping average curve on original curves
Dear useRs, my question could be very basic for which i apologize in advance. Each column of a matrix with dimensions 365 rows and 37 columns was drawn against another matrix of dimensions 365 rows and 1 column. with that i was able to draw 37 curves on the same axis. now i want to draw an average curve of these 37 curves on the same axis in such a way that all the curves (average and 37
2012 Oct 26
3
regression analysis in R
Dear useRs, i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i would like to know best 10 regression results, if i do regression analysis of dependent vector against the random combination of any 4
2006 Oct 11
1
Question about error of "non-numeric argument to binary operator"
Hi, I have the following data and there is no binary operator contained, however, I still receive the error message when running unitrootTest function, could someone give me a guidance on it?? >readClipboard() [1] "245" "246" "261.5" "275.5" "307" "284.5" "289" "313.5" "323.75"
2012 Nov 14
3
reversing distance matrix for original values
dear useRs, i created a distance matrix, of certain voltage values. unfortunately, i lost the original values. i am only left with the distance matrix that i created from those values. i wanted to ask that is there a way in R to reverse distance matrix for the original values? thanks in advance eliza [[alternative HTML version deleted]]
2012 Dec 24
2
whats wrong in my codes???
Dear R family,i am trying to plot and save, simultaneously, about 1000. the name of each plot is contained in "names" file. when i run this loop, i get an error. "Error in plot.new() : Unable to open file 'C:/R/SAVEHERE/myplot_Tak.jpg' for writing". could you please correct the mistake in the loop? >names<-(names(sp)) >for(a in seq_along(names)){ >mypath
2013 Oct 19
3
bold dot size and name in plot
Dear useRs, I have the following data "z" of two variables "x"(z[,1]) and "y"(z[,2]). > dput(z) structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
2012 Dec 24
2
colmeans not working
[text file is also attached in case you find the format of email difficult to understand] Dear useRs,You must all the planning for the christmas, but i am stucked in my office on the following issue i had a file containg information about station name, year, month, day, and discharge information. i opened it by using following command > dat1<-read.table("EL.csv",header=TRUE,
2013 Jan 02
2
loop correction needed
Dear useRs, i have a data frame with 16 lists in it. each list has variable number of lines. i want to create a loop which will start deleting every 32nd line in each list, till the end of each list. more precisely if a list has 200 rows i want to delete row number 32, 64, 96 and so on...for that i created the followng loop. >e<-lapply(seq(1),function(i)