Re: [Rd] New matrix function

2019-10-11 Thread Gabor Grothendieck
The link you posted used the same inputs as in my example. If that is not what you meant maybe a different example is needed. Regards. On Fri, Oct 11, 2019 at 2:39 PM Pages, Herve wrote: > > Has someone looked into the image processing area for this? That sounds > a little bit too high-level for

Re: [Rd] New matrix function

2019-10-11 Thread Pages, Herve
Has someone looked into the image processing area for this? That sounds a little bit too high-level for base R to me (and I would be surprised if any mainstream programming language had this kind of functionality built-in). H. On 10/11/19 03:44, Morgan Morgan wrote: > Hi All, > > I was

Re: [Rd] New matrix function

2019-10-11 Thread Gabor Grothendieck
I pressed return too soon. If we had such a multiply then which(embed(A, x) %==.&% reverse(x)) On Fri, Oct 11, 2019 at 10:57 AM Gabor Grothendieck wrote: > > Also note that the functionality discussed could be regarded as a > generalization > of matrix multiplication where * and + are

Re: [Rd] New matrix function

2019-10-11 Thread Joris Meys
As a package is a collection of functions, and as "base" is not used to refer to the base package but to all packages that form "base R" (so utils, graphics, stats, methods, parallel, ...), the functions in the parallel package are one example of functions incorporated in "base R" from a package.

Re: [Rd] New matrix function

2019-10-11 Thread Morgan Morgan
Your answer makes much more sense to me. I will probably end up adding the function to a package. Some processes and decisions on how R is developed seems to be obscure to me. Thank you Morgan On Fri, 11 Oct 2019 15:30 Avraham Adler, wrote: > It’s rather difficult. For example, the base R

Re: [Rd] New matrix function

2019-10-11 Thread Gabor Grothendieck
Also note that the functionality discussed could be regarded as a generalization of matrix multiplication where * and + are general functions and in this case we have * replaced by == and + replaced by &. On Fri, Oct 11, 2019 at 10:46 AM Gabor Grothendieck wrote: > > Using the example in the

Re: [Rd] New matrix function

2019-10-11 Thread Gabor Grothendieck
Using the example in the link here are two one-liners: A <- c(2,3,4,1,2,3,4,1,1,2) x <- c(1,2) # 1 - zoo library(zoo) which( rollapply(A, length(x), identical, x, fill = FALSE, align = "left") ) ## [1] 4 9 # 2 - Base R using conversion to character gregexpr(paste(x, collapse =

Re: [Rd] New matrix function

2019-10-11 Thread Avraham Adler
Perhaps. But aren’t you looking to implementation a function which finds a submatrix? If I’m confused, please accept my apologies. Avi On Fri, Oct 11, 2019 at 10:43 AM Morgan Morgan wrote: > I think you are confusing package and function here. Plus some of the R > Core packages, that you

Re: [Rd] New matrix function

2019-10-11 Thread Morgan Morgan
I think you are confusing package and function here. Plus some of the R Core packages, that you mention, contain functions that should probably be replaced by functions with better implementation from packages on CRAN. Best regards Morgan On Fri, 11 Oct 2019 15:22 Joris Meys, wrote: > > > On

Re: [Rd] New matrix function

2019-10-11 Thread Avraham Adler
It’s rather difficult. For example, the base R Kendall tau is written with the naive O(n^2). The much faster O(n log n) implementation was programmed and is in the pcaPP package. When I say much faster, I mean that my implementation in Excel VBA was faster than R for 10,000 or so pairs. R-Core

Re: [Rd] New matrix function

2019-10-11 Thread Morgan Morgan
How do you prove usefulness of a feature? Do you have an example of a feature that has been added after proving to be useful in the package space first? Thank you, Morgan On Fri, 11 Oct 2019 13:53 Michael Lawrence, wrote: > Thanks for this interesting suggestion, Morgan. While there is no

Re: [Rd] New matrix function

2019-10-11 Thread Michael Lawrence via R-devel
Thanks for this interesting suggestion, Morgan. While there is no strict criteria for base R inclusion, one criterion relevant in this case is that the usefulness of a feature be proven in the package space first. Michael On Fri, Oct 11, 2019 at 5:19 AM Morgan Morgan wrote: > On Fri, 11 Oct

Re: [Rd] New matrix function

2019-10-11 Thread Wang Jiefei
Hi Morgan, I think there is a discussion on how developers include a function in base R in another thread: https://stat.ethz.ch/pipermail/r-devel/2019-October/078551.html Best, Jiefei On Fri, Oct 11, 2019 at 8:19 AM Morgan Morgan wrote: > On Fri, 11 Oct 2019 10:45 Duncan Murdoch, > wrote:

Re: [Rd] New matrix function

2019-10-11 Thread Morgan Morgan
On Fri, 11 Oct 2019 10:45 Duncan Murdoch, wrote: > On 11/10/2019 6:44 a.m., Morgan Morgan wrote: > > Hi All, > > > > I was looking for a function to find a small matrix inside a larger > matrix > > in R similar to the one described in the following link: > > > > >

Re: [Rd] New matrix function

2019-10-11 Thread Spencer Graves
On 2019-10-11 04:45, Duncan Murdoch wrote: On 11/10/2019 6:44 a.m., Morgan Morgan wrote: Hi All, I was looking for a function to find a small matrix inside a larger matrix in R similar to the one described in the following link:

Re: [Rd] New matrix function

2019-10-11 Thread Duncan Murdoch
On 11/10/2019 6:44 a.m., Morgan Morgan wrote: Hi All, I was looking for a function to find a small matrix inside a larger matrix in R similar to the one described in the following link: https://www.mathworks.com/matlabcentral/answers/194708-index-a-small-matrix-in-a-larger-matrix I couldn't

[Rd] New matrix function

2019-10-11 Thread Morgan Morgan
Hi All, I was looking for a function to find a small matrix inside a larger matrix in R similar to the one described in the following link: https://www.mathworks.com/matlabcentral/answers/194708-index-a-small-matrix-in-a-larger-matrix I couldn't find anything. The above function can be seen as