similar to: Calculate across columns

Displaying 20 results from an estimated 10000 matches similar to: "Calculate across columns"

2008 Nov 06
2
comparing matrices using max or min
Dear all, I have 3 matrices with the same dimension, A,B,C and I would like to produce a matrix D where in each position would retrieve the max(or min) value along A,B,C taken from the same position. I guess that apply functions should fit, but for matrices objects I am not getting it. thanks in advance, Diogo André Alagador [[alternative HTML version deleted]]
2008 Oct 20
2
calculating mean for samples
Hi everyone, > does any one knows how can I calculate mean for different samples > i.e. I have a data like this: > > s1 s2 s3 s4 > 1 0 0 0 1 > 2 1 0 1 0 > 3 0 0 0 0 > 4 0 0 0 0 > 5 0 1 0 1 > 6 1 0 0 0 > 7 0 0 0 0 > 8 0 0 0 0 > 9 0 0 0 0 > 10 0 0 0 1 > > I need to make 5 different sample with 5
2009 Mar 22
1
using wavelet transform to calculate mean frequency of a signal
Dear list, in short: I would like to calculate the mean frequency of a signal (e.g. time series) using the wavelet transform. with details: I did not find a R function to calculate a mean frequency using one of the cran packages. My searches using R Site Search returned: **(1)waveclock {waveclock} R Documentation Reconstruction of the modal frequencies in a time series using continuous
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,
2018 Feb 20
2
Take the maximum of every 12 columns
On Tue, Feb 20, 2018 at 11:58 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > Ista, et. al: efficiency? > (Note: I needed to correct my previous post: do.call() is required for > pmax() over the data frame) > > > x <- data.frame(matrix(runif(12e6), ncol=12)) > > > system.time(r1 <- do.call(pmax,x)) > user system elapsed > 0.049 0.000
2009 Sep 15
2
How to calculate min of a dataset that contains empty column
Hi all, I have got a dataset like the following: a b c 1 5 2 3 7 I am taking the minimum of each column and use it as the minimum of the y-axis of my graphs. My scripts (simplified version) are like the following: f<-array f[1]=a f[2]=b f[3]=c for i in 1:3 name=f[i] ymin<-min(dataset$f[i]) plot(x,y,ylim=c(ymin,100)) The script stops at b, because the min function returns inf
2018 Feb 20
0
Take the maximum of every 12 columns
It looks like OP uses a data.frame, so in order to use matrixStats (I'm the author) one would have to pay the price to coerce to a matrix before using matrixStats::rowMaxs(). However, if it is that the original data could equally well live in a matrix, then matrixStats should be computational efficient for this task. (I've seen cases where an original matrix was turned into a data.frame
2010 Aug 03
2
subset based on column names and then subset based on the inverse (grep?, or...)
I would like to be able to grab x and y columns out of a dataframe and then grab all of the columns that are not equal to x or y. I am sure that I am missing something easy. ftbr_UTM_downstream <- (structure(list(site = c("Jennie_Creek_Main_Stem", "Wolf_Pit_Creek_Main_Stem", "Little_Rockfish_Main_Stem_North", "Big_Muddy_Creek_Main_Stem",
2018 Feb 20
0
Take the maximum of every 12 columns
Ista, et. al: efficiency? (Note: I needed to correct my previous post: do.call() is required for pmax() over the data frame) > x <- data.frame(matrix(runif(12e6), ncol=12)) > system.time(r1 <- do.call(pmax,x)) user system elapsed 0.049 0.000 0.049 > identical(r1,r2) [1] FALSE > system.time(r2 <- apply(x,1,max)) user system elapsed 2.162 0.045 2.207 ##
2008 Sep 25
1
Splitting row names up and then adding up the columns associated with criteria from the parts of the site coding (help)
d <- c("upwd1201", "upwd0502", "upwd0702", "upwd1002", "upwd1102", "upwd0203", "upwd0503", "upwd0803", "upwd0104", "upwd0704", "upwd0804", "upwd1204", "upwd0805", "upwd1005", "upwd0106", "dnwd1201", "dnwd0502",
2010 Jul 01
3
Calculate area under a curve
Hi, I want to know the area under a curve, which is not given as a function, but as values in a time series. It is not a smooth curve, but switches often between positive values and zero (the values describe the moisture in the soil over a year, one entry is one day). I already tried area.between.curves, but got only 0 as result. I guess, it doesn't work because of these multiple changes
2009 Mar 18
1
Reading a file line by line - separating lines VS separating columns
Hello all. I wish to read a large data set into R. My current issue is in getting the data so that R would be able to access it. Using read.table won't work since the data is over 1GB in size (and I am using windows XP), so my plan was to read the file chunk by chunk and each time move it into bigmemory (I'll play with that when the time will come, maybe ff is better ?!). I encountered
2009 Aug 21
5
splitting a string up
x <- "1041281__2009_08_20_.lev" I would like to split this string up and only extract the leading numbers. 1041281 to use as a label for a data column in a bigger for loop function to read in data. regards, -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us
2009 Jan 15
3
Bar Plot ggplot2 Filling bars with cross hatching
#I am putting a test together for an introductory biology class and I would like to put different cross hatching inside of each bar for the bar plot below color <- c("Brightly Colored", "Dull", "Neither") lizards <- c(277, 70, 3) liz.col <- data.frame(color, lizards) qplot(color, lizards, data=liz.col, geom="bar", ylab="Observed Matings",
2009 Aug 13
3
split number in a vector and then make a chron object out of it
These are date and times in the format YYYYMMDDhhmmss. I would like to take this column and make a chron object form them. I have tried a couple of the split family of functions but they need character input here is the data: date.time <- c(19851001001500, 19851001003000, 19851001004500, 19851001010000, 19851001011500, 19851001013000, 19851001014500, 19851001020000, 19851001021500,
2008 Nov 20
1
Calculate an equation
Dear all, I was wondering if you could help me with the following. I want to do calculate this equation: Ps(t)= (?_(r=1)^N Xtr* 1/?drs)/(?_(r=1)^N 1/?drs) Ps(t) ? Probability that taxon t will occur at site s (300 sites s) N ? Number of sites = from 1 to 49 Xtr ? Value for taxon t at site r (I have this information in a table, 40 taxa (columns) t, 49 sites r) drs ? Distance from site r to
2008 Jun 25
2
I want to install a package on Max OS X from a local file
I can't figure this one out- I am the administrator, The file that I want to install is a .tar.gz which is located on my desktop. How do I get it into my packages directory- through the GUI or through brute force? thanks stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel
2008 Oct 01
3
for loop question Documentation and its application for calculating euclidean distance on MDS ordination axis scores
?for doesn't return anything help.search("for") doesn't return anything- Is the for loop so prevelant in computer programing that the documentation is implicit or is R paradigm to discourage the use of the for loop. I will post data probably tonight, but here is my problem. I have preformed an MDS on a set of data. I have the scores of the four axes that are the optimal
2008 Sep 11
3
periodicity validation
There is a series of data contains time in fixed step and energy varying with time, how to test its periodicity?In R, it seems there is no direct tools since I have search the R manual with periodic and I have not found any related topic. Thanks a lot
2008 Aug 18
4
Multiple Plotting help (lines don't always connect)
d <- structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, NA, NA, NA, 14), .Dim = c(14L, 2L ), .Dimnames = list(NULL, c("a", "b"))) plot(d, type="b") This is simplified, but Is there an option I am missing that will force all of the points to be joined by a line? Stephen Sefick -- Let's not spend our time and resources