similar to: Row means of matrix.

Displaying 20 results from an estimated 20000 matches similar to: "Row means of matrix."

2017 Apr 01
3
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
In R 3.3.3, I observe the following on Ubuntu 16.04 (when building from source as well as for the sudo apt r-base build): > x <- c(NA, NaN) > mean(x) [1] NA > mean(rev(x)) [1] NaN > rowMeans(matrix(x, nrow = 1, ncol = 2)) [1] NA > rowMeans(matrix(rev(x), nrow = 1, ncol = 2)) [1] NaN > .rowMeans(x, m = 1, n = 2) [1] NA > .rowMeans(rev(x), m = 1, n = 2) [1] NaN >
2017 Apr 01
1
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
On Fri, Mar 31, 2017 at 10:14 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: > From ?NA > > Numerical computations using ?NA? will normally result in ?NA?: a > possible exception is where ?NaN? is also involved, in which case > either might result. > > and ?NaN > > Computations involving ?NaN? will return ?NaN? or perhaps ?NA?: >
2009 Oct 31
3
Plots with k-means
Hi, I'm doing a k-means cluster with 6 clusters and 15 variables. Any suggestions on how to plot the results? I've tried the standard xy plot, but couldn't get much of it. Thansk in advance, Iuri.
2010 Jan 15
2
How to delete matrix rows based on NA frequency?
Hi all, I would like to remove rows from a matrix, based on the frequency of missing values. If there are more than 10 % missing values, the row should be deleted. I use the following to calculate the frequencies, thereby getting a new matrix with the frequencies: freqNA=rowMeans(is.na(exprdata)) But is there a shorter way to remove the rows based on "(1-freqNA)>0.1"
2009 Aug 20
2
Geometric mean of rows in matrix
Is there a function or an easier way to computer geometric means of each rows in a nxn matrix and spit out in an 1xn matrix ? -- Edward Chen [[alternative HTML version deleted]]
2005 Jul 19
3
extracting row means from a list
Hello: I'm reading in a series of text files (100 files that are each 2000 rows by 6 columns). I wish to combine the columns (6) of each file (100) and get the row mean. I'd like to end up with a data.frame of 2000 rows by 6 columns. foo <- list() for(i in 1:10){ # The real data are read in from a series of numbered text files foo[[i]] <- data.frame(x1 = rnorm(100), x2 =
2011 Jan 10
1
replace values in array with means of certain values in array
Een ingesloten tekst met niet-gespecificeerde tekenset is gescrubt ... Naam: niet beschikbaar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110110/596768d9/attachment.pl>
2011 Apr 05
1
Inconsistency between rowMeans documentation and reality?
Dear List, I'm not even sure this is an issue or not, but ?rowMeans has: Value: A numeric or complex array of suitable size, or a vector if the result is one-dimensional. The ?dimnames? (or ?names? for a vector result) are taken from the original array. If there are no values in a range to be summed over (after removing missing values with ?na.rm = TRUE?), that
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called heatmap.w.row.and.col.clust which auto-generates breaks using breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20, digits = 2) #(stddev in this case = 2.5) This has always worked well in the past but now I am getting an error that non-finite breaks are being generated. Drilling down, it seems that my wrapper is generating finite
2011 Jul 11
2
running mean in blocks
Hello, I am running R on Linux and have a column of data 10000 points long. I would like to take a moving average of say 100 points at a time, so I end up with one column of 100 points. What is the simplest way of doing this? I would like to be able to adjust the width of the averaging blocks. Thanks much! [[alternative HTML version deleted]]
2007 Mar 01
2
Row-wise two sample T-test on subsets of a matrix
Hello all, I am trying to run a two sample t-test on a matrix which is a 196002*22 matrix. I want to run the t-test, row-wise, with the first 11 columns being a part of the first group and columns 12-22 being a part of the second group. I tried running something like (temp.matrix being my 196002*22 matrix) t.test(temp.matrix[,1:11],temp.matrix[,12:22],paired=TRUE) or somthing like
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,
2005 Feb 07
4
proportional matrix rows
Hi I have a two-column integer matrix like this: R> jj [,1] [,2] [1,] -1 1 [2,] -2 2 [3,] -7 6 [4,] -8 7 [5,] -6 5 [6,] -9 8 [7,] -5 4 [8,] 3 -3 [9,] -10 9 [10,] -4 3 I want a diagnostic that detects whether a row is a multiple of the first row or not. In this case, this would be rows 1,2, and 8. How to do this
2007 Nov 01
2
computing the mean of a few variables
hello, I have a simple question: I want to compute the average of 6 variables, my data looks like this: t0 t1 t2 t3 t4 t5 1 32 34 36 40 38 40 2 35 37 38 36 33 39 . . . I want the mean of t0-t5 for each row (observation). thank you, sigalit. [[alternative HTML version deleted]]
2010 Jun 25
4
Average 2 Columns when possible, or return available value
Forum, Using the following data: DF<-read.table(textConnection("A B 22.60 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 102.00 NA 19.20 NA 19.20 NA NA NA NA NA NA NA 11.80 NA 7.62 NA NA NA NA NA NA NA NA NA NA NA 75.00 NA NA NA 18.30 18.2 NA NA NA NA 8.44 NA 18.00 NA NA NA 12.90 NA"),header=T) closeAllConnections() The second column is a duplicate
2013 Jul 20
1
how to calculate the average values of each row in a matrix
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks like (cited from Michael Friendly) I would like to get the average value of each color. Obs
2010 Jun 01
2
Problem using apply
Hello , I can not get apply function to do what I want when doing stuff on rows. Let's say I want to divide the rows of matrix by their mean, the below show you get the same result weather you use 1 or 2, i.e. same result for columns than for means..:( Thanks a lot for the help, m = matrix( c(1,4,7,4,5,8,7,8,9), nrow = 3 ) divideByMean = function( v ){ return(
2004 Dec 03
1
How to wrap or split labels on plot
Dear R gurus, I want to wrap labels that are too long for a plot. I have looked at strsplit(), substr(), nchar(), and strwrap(). I think it's some combination but I'm having difficulty trying to figure out the right combo. I think I need to create some new matrix containing the labels already split, though I'm not sure if maybe there is a quick and dirty way to address this
2010 Apr 27
5
get means of elements of 5 matrices in a list
I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a 5 x 6 matrix that contains the mean value of the 5 original matrices. I can do this by brute force, but there must be a better way than making each matrix into a vector and then remaking a matrix thanks very much for any help david freedman ll=list(structure(c(9.7, 17.6, 20.8, 24.1, 33.8, 14.5, 25.7, 29.8,
2011 Jul 19
3
calculating the mean of a random matrix (by row) and some general questions
Hi everyone! I'm trying to teach myself R in order to do some data analysis. I'm a mathematics student and (only) familiar with matlab and latex. I'm working trough the "official" introduction to R at the moment, while simultaneously solving some exercises I found in the web. Before I post my (probably stupid) question, I'd like to ask you for some general advice. How do