similar to: `dendrapply` Enhancements

Displaying 20 results from an estimated 800 matches similar to: "`dendrapply` Enhancements"

2023 Feb 23
1
`dendrapply` Enhancements
Hi everyone, My apologies if this isn?t the right place to submit this?I?m new to the R-devel community and still figuring out what is where. If people want to skip my writeup and just look at the code, I?ve made a repository for it here: https://github.com/ahl27/new_dendrapply/tree/master. I?m not quite sure how to integrate it into a fork of R-devel; the package structure is different from
2024 Jan 17
2
cwilcox - new version
> > > Performance statistics are interesting. If we assume the two populations > have a total of `m` members, then this implementation runs slightly slower > for m < 20, and much slower for 50 < m < 100. However, this implementation > works significantly *faster* for m > 200. The breakpoint is precisely when > each population has a size of 50; `qwilcox(0.5,50,50)`
2023 Nov 06
2
New syntax for positional-only function parameters?
Dear List, I'm writing to gauge interest in new syntax for positional-only function parameters to be added to R. The pattern of functions accepting other functions as inputs and passing additional ... arguments to them is prevalent throughout the R ecosystem. Currently, however, all such functions must one way or another tackle the problem of inadvertently passing arguments meant to go to
2024 Feb 08
2
round.Date and trunc.Date not working / implemented
> On 8 Feb 2024, at 15:15, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>> Ji?? Moravec >>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: > >> This is my first time working with dates, so if the answer is "Duh, work >> with POSIXt", please ignore it. > >> Why is not `round.Date` and
2024 Jan 15
2
cwilcox - new version
I am a newbie to C (although I did some programming in Perl and Pascal) so forgive me for the language that follows. I am writing because I have a question concerning the *implementation of *(the internal function)* cwilcox* in https://svn.r-project.org/R/!svn/bc/81274/branches/R-DL/src/nmath/wilcox.c. This function is used to determine the test statistics of the Wilcoxon-Mann-Whitney U-test.
2009 Sep 29
3
How do I access class slots from C?
Hi I'm trying to implement something similar to the following R snippet using C. I seem to have hit the wall on accessing class slots using C. library(fPortfolio) lppData <- 100 * LPP2005.RET[, 1:6] ewSpec <- portfolioSpec() nAssets <- ncol(lppData) setWeights(ewSpec) <- rep(1/nAssets, times = nAssets) ewPortfolio <- feasiblePortfolio( data = lppData, spec = ewSpec,
2014 Jun 25
1
Need help on calling Head from C
Hi , I am trying to call head function from C . My doubt is with the parameter n,how to pass it . PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE))); SET_TAG(CDDR(dfm), install("stringsAsFactors")) ; SEXP res = PROTECT(eval(dfm,R_GlobalEnv)); PROTECT(head=lang3(install("head"),res,ScalarInteger(1))); head = PROTECT(eval(head,R_GlobalEnv)); I tried
2024 Jan 16
1
cwilcox - new version
I?ve been looking at this for a couple hours--it ended up being trickier than I expected to implement well. I?ve attached a new patch here. This version scales significantly better than the existing method for both `pwilcox` and `dwilcox`. Examples are included below. I can?t think of any other ways to improve runtime at this point. That?s not to say there aren?t any, though?I?m hopeful
2007 Aug 16
0
call R function in c++ program
Hi all I don't know if my message are correct in this forums. I create a program in c++ who use statistical function. I want to execute this function in R (in particular for use packages ade4, lattice, bioconductor...) Until now, my program work for simple function ("plot", "rnorm"...) but I can't use library My class are : // in constructor int argc = 1;
2009 Oct 29
2
Help with lang4
Hi I seem to have run into a situation where I have more than 3 arguments to pass to a function from C. the following functions help me build an expression for evaluation: lang lang2 lang3 lang4 What should one do if there are more arguments than lang4 can handle? Regards Abhijit Bera [[alternative HTML version deleted]]
2019 Nov 01
3
R C api for 'inherits' S3 and S4 objects
Dear R developers, Motivated by discussion about checking inheritance of S3 and S4 objects (in head matrix/array topic) I would light to shed some light on a minor gap about that matter in R C API. Currently we are able to check inheritance for S3 class objects from C in a robust way (no allocation, thread safe). This is unfortunately not possible for S4 classes. I would kindly request new
2012 May 23
2
Expected behaviour of is.unsorted?
Hi, I've read ?is.unsorted and searched. Have found a few items but nothing close, yet. Is the following expected? > is.unsorted(data.frame(1:2)) [1] FALSE > is.unsorted(data.frame(2:1)) [1] FALSE > is.unsorted(data.frame(1:2,3:4)) [1] TRUE > is.unsorted(data.frame(2:1,4:3)) [1] TRUE IIUC, is.unsorted is intended for atomic vectors only (description of x in ?is.unsorted). Indeed
2009 Sep 16
2
I want to get a reference to this time series object
I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work because "[" is obviously not an operation or function on SWX.RET. So how do I
2024 Feb 12
0
Errors in wilcox family functions
Hi Everyone, Following the previous discussion on optimizing *wilcox functions, Andreas Loeffler brought to my attention a few other bugs in `wilcox` family functions. It seems like these issues have been discussed online in the past few months, but I haven?t seen discussion on R-devel...unless I missed an email, it seems like discussion never made it to the mailing list. I haven?t seen any bug
2009 Sep 15
1
How can I use R:sort function in C code?
Hi, I wrote a C extension for R. Within the C code I wanted to invoke the R's sort function, with the argument "index.return = TRUE". I found it is a difficult problem, how can I do that? I have implemented the decreasing sorting by the code "PROTECT(R_fcall = lang3(install("sort"), x, desc));", but how to define the "index.return" argument? Thanks in
2005 May 18
0
dendrogram and dendrapply
Hi all, I think I have some problems to use correctly the function dendrapply. Let suppose dend is a dendrogram object. I would likde to know the cardinal number of leaves depending of each node of the tree dend. It is right that the command attr(dend,"members") gives the total number of leaves, and attr(dend[[1]],"members") gives the number of leaves for the first left
2019 Nov 01
4
[External] R C api for 'inherits' S3 and S4 objects
Thank you Luke. That is why I don't use Rf_inherits but INHERITS which does not allocate, provided in the email body. I cannot do similarly for S4 classes, thus asking for some API for that. On Fri, Nov 1, 2019 at 5:56 PM Tierney, Luke <luke-tierney at uiowa.edu> wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Dear R developers, > > > > Motivated by
2009 Aug 25
2
Clarifications please.
Hi I think I have asked these questions earlier, but I been able to find answers from the documentation (which I found poorly written in several places). Will someone be kind enough to give me answers and enlighten me? (as in explain with CODE?) I want to embed R in my application and use the fPortfolio package for carrying out risk management computations. Right now I'm reading the Rmetrics
2007 Nov 25
2
accessing the "address" of items in a recursive list
Dear useRs, I am working on a project involving the clustering of a large dataset. I need to extract specific sub-clusters from the parent dendrogram for further analysis. The data is too large for the use of convenient tools such as identify.clust (it selects the specific group of interest on a graph), so alternatively I have saved the plot as a large image file so that it can be printed or
2009 May 26
1
passing "..." arguments to a function called by eval()
Hi everyone, I am starting learn to call C code from within R. So far, I've been trying toy problems to see if I can get them to work. One of the things I'd like to do is pass an arbitrary R function to C, evaluate the value in the C code using eval, and then return it. I also want to allow an arbitrary number of arguments to the function using "...". The code for my toy