similar to: Suggestion: Adding quick rowMin and rowMax functions to base package

Displaying 20 results from an estimated 1000 matches similar to: "Suggestion: Adding quick rowMin and rowMax functions to base package"

2012 Apr 19
4
Column(row)wise minimum and maximum
Hi, Currently, the "base" has colSums, colMeans. It seems that it would be useful to extend this to also include colMin, colMax (of course, rowMin and rowMax, as well) in order to facilitate faster computations for large vectors (compared to using apply). Has this been considered before? Please forgive me if this has already been discussed before. Thanks, Ravi Ravi Varadhan, Ph.D.
2011 Feb 15
1
matrixStats: Extend to arrays too (Was: Re: Suggestion: Adding quick rowMin and rowMax functions to base package)
Hi. On Sun, Feb 13, 2011 at 10:18 AM, TakeoKatsuki <takeo.katsuki at gmail.com> wrote: > > Hi Henrik, > > It would be nice if functions of the matrixStats package can handle array > data. > For example, rowSums() of the base package sums along the third axis of an > array by rowSums(x, dim=2). That is a good idea. This was indeed the initial objective before starting
2008 Feb 10
2
View() + "End" key on Ubuntu=segfault
I can repeatably crash R (segfault) by doing n <- 10 z <- data.frame(a=1:n,b=1:n) View(z) and then hitting the "End" key on my keyboard. I haven't got debugging going yet, but running under gdb (without debugging symbols) does give this: 0xb7b63583 in strlen () from /lib/tls/i686/cmov/libc.so.6 R version 2.6.2 (2008-02-08) i486-pc-linux-gnu [Ubuntu Gutsy] locale:
2009 Apr 01
2
Plotting multiple ablines
I really want to do this: abline( a=tan(-kT*pi/180), b=kY-tan(-kT*pi/180)*kX ) where kX,kY and kT are vectors of equal length. But I can't do that with abline unless I use a loop, and I haven't figured out the least unelegant way of writing the loop yet. So is there a way to do this without a loop? Or if I am to resort to the loop, what's the best way of doing it considering that I
2012 Dec 08
5
How to efficiently compare each row in a matrix with each row in another matrix?
Dear expeRts, I have two matrices A and B. They have the same number of columns but possibly different number of rows. I would like to compare each row of A with each row of B and check whether all entries in a row of A are less than or equal to all entries in a row of B. Here is a minimal working example: A <- rbind(matrix(1:4, ncol=2, byrow=TRUE), c(6, 2)) # (3, 2) matrix B <-
2013 Apr 26
2
[LLVMdev] CallGraph
Thanks for the response. I looked and I cannot see what exactly I need. I saw getCalledFunction() so I need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an instruction. It seems not easier than the "unelegant" version....if I am still at the Instruction level... I need a method that takes from a "leaf" basic block from a function (Maybe there is
2006 Jan 20
1
Update HTML Element with Ajax
I have following files. list.rhtml ----------------------- <ul id="items"> <%= render(:partial => ''item'', :collection => @items) %> </ul> _item.rhtml ------------------------ <li id="<%= item.id %>" > <%= item.name %> <%= item.body %> </li> edit.rjs ------------------------ page.replace_html
2002 Jan 28
4
Functions on matrix row level
Hi together, I have some data in a matrix structure - say 1000 rows with 10 columns. And I like to do some calculations (like max, avg or min) on row level. The only solution I found so fare was using a loop like for (i in 1:1000) { max[i] <- max(matrix[I,]) } It looks like that this is not very fast. Does an other way exists? Kind regards Ulrich
2013 Apr 26
0
[LLVMdev] CallGraph
Hi, On 26/04/13 13:17, Alexandru Ionut Diaconescu wrote: > Thanks for the response. > I looked and I cannot see what exactly I need. I saw getCalledFunction() so I > need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an > instruction. It seems not easier than the "unelegant" version....if I am still > at the Instruction level... the call graph
2005 Apr 27
1
ncdf with opendap/dods support
Aloha, I just made some quick hacks on the configure script with the 'ncdf' package to make it link with the opendap/dods libraries (opendap.org) rather than the netcdf api library. Basically, this allows a user to interact in R with a remotely served dataset as if it were a netcdf file on the local filesystem (read-only). Functionality with local files should continue to work as
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
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
2012 Sep 19
4
correlating matrices
Hi, thank you for taking the time and reading my question. My question is twofold: 1. I have several matrices with variables and one matrix with water levels. I want to predict the water level with the data in the other matrices. Basically, * mod<-lm(matrix1 ~ matrix2+matrix3)* ( What looks like a minus is meant to be the wiggly minus.) Of course I could dissemble the matrices and paste
2011 Aug 18
3
Coding question for behavioral data analysis
Hello all, I have a question which I have been struggling with for several weeks now, that I think might be easy for more proficient coders than myself. I have a large behavioral dataset, with behaviors and the times (milliseconds) that they occurred. Each subject has a separate file, and a sample subject file can be generated using the following syntax: Time <- c(1000, 1050, 1100, 1500, 2500,
2005 Apr 14
0
predict.glm(..., type="response") dropping names (and a propsed (PR#7792)
Here's a patch that should make predict.glm(..., type="response") retain the names. The change passes make check on our Opteron running SLES9. One simple test is: names(predict(glm(y ~ x, family=binomial, data=data.frame(y=c(1, 0, 1, 0), x=c(1, 1, 0, 0))), newdata=data.frame(x=c(0, 0.5, 1)), type="response")) which gives [1]
2010 Apr 23
0
dot dot dot and NextMethod
Hello, Within the development of a package, I would need to build a specific method for the "pmin" function. I first make "pmin" generic pmin <- function (..., na.rm = FALSE) UseMethod("pmin") pmin.default <- base::pmin Now, within my new method, I would like to change the arguments in . (dot dot dot) before sending it to the NextMethod.
2015 Jan 26
0
matrixStats 0.13.1 - Methods that Apply to Rows and Columns of a Matrix (and Vectors)
A new release 0.13.1 of matrixStats is now on CRAN [http://cran.r-project.org/package=matrixStats]. The source code is available on GitHub [https://github.com/HenrikBengtsson/matrixStats]. WHAT DOES IT DO? The matrixStats package provides highly optimized functions for computing common summaries over rows and columns of matrices, e.g.rowQuantiles(). There are also functions that operate on
2015 Jan 26
0
matrixStats 0.13.1 - Methods that Apply to Rows and Columns of a Matrix (and Vectors)
A new release 0.13.1 of matrixStats is now on CRAN [http://cran.r-project.org/package=matrixStats]. The source code is available on GitHub [https://github.com/HenrikBengtsson/matrixStats]. WHAT DOES IT DO? The matrixStats package provides highly optimized functions for computing common summaries over rows and columns of matrices, e.g.rowQuantiles(). There are also functions that operate on
2011 Oct 04
1
a question about sort and BH
Hi, I have two questions want to ask. 1. If I have a matrix like this, and I want to figure out the rows whose value in the 3rd column are less than 0.05. How can I do it with R. hsa-let-7a--MBTD1 0.528239197 2.41E-05 hsa-let-7a--APOBEC1 0.507869409 5.51E-05 hsa-let-7a--PAPOLA 0.470451884 0.000221774 hsa-let-7a--NF2 0.469280186 0.000231065 hsa-let-7a--SLC17A5
2005 Dec 20
0
pmin(), pmax() - slower than necessary for common cases
A few hours ago, I was making a small point on the R-SIG-robust mailing list on the point that ifelse() was not too efficient in a situation where pmax() could easily be used instead. However, this has reminded me of some timing experiments that I did 13 years ago with S-plus -- where I found that pmin() / pmax() were really relatively slow for the most common case where they are used with only