sdcTools / sdcMicro

sdcMicro
http://sdctools.github.io/sdcMicro/
79 stars 23 forks source link

CRAN warning, urgent #309

Closed matthias-da closed 3 years ago

matthias-da commented 3 years ago

I have already debugged and checked all order() calls and could not see anywhere that an order is called on a data-frame. But I can imagine that it is related to data.table, because subsetting with [, i] is not automatically converted to a vector here. So it could be that somewhere a data.table is produced and then order would be applied on a data.table / data.frame.

Apparently you can be more specific to find the problem with: To easily identify the calls to be changed, you could setenv _R_STOP_ON_XTFRM_DATAFRAME=true and use a current version of R-devel.

Can someone please take a look at/with the setenv + R-devel, please? Then according to Kurt we would easily see where the problem occurs. I would avoid myself to update to R-devel now, because I'm in the middle of a paper with keras and tensorflow and do not want to risk that I again have to do a lot of work to keep both packages running with different python versions on my machine

Thank you very much!

Below the message from Kurt Hornik.

Kind regards Matthias

Dear maintainers,

This concerns the CRAN packages

LN0SCIs LncMod PCovR RatingScaleReduction STV ahp eatATA ecospat forestSAS mvabund rysgran sdcMicro

maintained by one of you:

Alicja Wolny-Dominiak alicja.wolny-dominiak@ue.katowice.pl: RatingScaleReduction Benjamin Becker b.becker@iqb.hu-berlin.de: eatATA Christoph Glur christoph.glur@ipub.com: ahp David Warton David.Warton@unsw.edu.au: mvabund Eliandro Ronael Gilbert eliandrogilbert@gmail.com: rysgran Jing Xu 274762204@qq.com: LN0SCIs John Emerson john.emerson@yale.edu: STV Marlies Vervloet marlies.vervloet@ppw.kuleuven.be: PCovR Matthias Templ matthias.templ@gmail.com: sdcMicro Olivier Broennimann olivier.broennimann@unil.ch: ecospat Zishan Wang azureskyeric@gmail.com: LncMod Zongzheng Chai chaizz@126.com: forestSAS

As I already wrote one month ago:

You may have seen that when running your package code with current r-devel, one gets warnings about

cannot xtfrm data frames

This is because you call order() on a data frame with 1 row and k columns which (currently) returns something of length k.

Now,

? sort says

 Sort (or _order_) a vector or factor (partially) into ascending or
 descending order.  For ordering along more than one variable,
 e.g., for sorting data frames, see ‘order’

where in turn ? order says

 ‘order’ returns a permutation which rearranges its first argument
 into ascending or descending order, breaking ties by further
 arguments.  ‘sort.list’ does the same, using only one argument.
 See the examples for how to use these functions to sort data
 frames, etc.

and then the examples clearly explain to use do.call() for data frames, ideally also unnaming to avoid name clashes.

Can you please change your package code to no longer call order() on data frames?

To easily identify the calls to be changed, you could setenv _R_STOP_ON_XTFRM_DATAFRAME=true and use a current version of R-devel.

Note that this will be the final reminder.

Best -k

alexkowa commented 3 years ago

Fixed. But before CRAN release probably the URLS to http://neon.vb.cbs.nl/ must be fixed -> #310

alexkowa commented 3 years ago

@matthias-da: I just submitted to winbuilder r-devel and r-release. If it comes back OK, it can go to CRAN. The only notes in the check are for two https links with self-signed certificates "curl error code 60", which hopefully will be accepted by CRAN. Maybe you should add a note on that when you submit it.