Re: [Rd] Is ALTREP "non-API"?

2024-04-24 Thread Hadley Wickham
A few more thoughts based on a simple question: how do you determine the length of a vector? Rf_length() is used in example code in R-exts, but I don't think it's formally documented anywhere (although it's possible I missed it). Is using in an example sufficient to consider a function to be part

Re: [Rd] Is ALTREP "non-API"?

2024-04-24 Thread Hadley Wickham
> > > > >>> That is not true at all - the presence of header does not constitute > >> declaration of something as the R API. There are cases where internal > >> functions are in the headers for historical or other reasons since the > >> headers are used both for the internal implementation and

Re: [Rd] Is ALTREP "non-API"?

2024-04-23 Thread Hadley Wickham
> > > > > > ALTREP is part of the official R api, as illustrated by the presence of > > > src/include/R_ext/Altrep.h. Everything declared in the header files in > that > > > directory is official API AFAIK (and I believe that is more definitive > than > > > the manuals). > > > > > > > That is not

Re: [Rd] Is ALTREP "non-API"?

2024-04-22 Thread Hadley Wickham
On Mon, Apr 22, 2024 at 5:14 PM Simon Urbanek wrote: > > > > On Apr 22, 2024, at 7:37 PM, Gabriel Becker > wrote: > > > > Hi Yutani, > > > > ALTREP is part of the official R api, as illustrated by the presence of > > src/include/R_ext/Altrep.h. Everything declared in the header files in > that

Re: [R-pkg-devel] @doctype is deprecated. need help for r package documentation

2024-03-07 Thread Hadley Wickham
Do you have a pointer to the roxygen2 comments that you're using? Hadley On Thu, Mar 7, 2024 at 5:38 AM Ruff, Sergej wrote: > Hello, > > I need help with a package I am currently developing called bootGSEA. > I noticed that when I try ‘?bootGSEA’ it goes to the help page in R > itself but not

Re: [R-pkg-devel] how to use pkgdown::build_site() with a project using S7 with a specialized plot()?

2024-01-03 Thread Hadley Wickham
ackage, "as it's used in the reference > index.") > 35. base::stop(cnd) > 36. (function (cnd) … > 37. cli::cli_abort(message, location = i, name = name, parent = cnd, … > 38. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, … > 39. | rlang:::signal_abort(

Re: [R-pkg-devel] how to use pkgdown::build_site() with a project using S7 with a specialized plot()?

2024-01-03 Thread Hadley Wickham
This bug is fixed in the dev version (I don’t remember off the top of my head in which of pkgdown and roxygen2 you need but it might be both). I’m planning CRAN updates for both in the near future. Hadley On Thursday, January 4, 2024, Daniel Kelley wrote: > # Question > > Is there an online

Re: [R-pkg-devel] Discrepancy between R CMD check results and usethis::use_cran_comments

2023-09-26 Thread Hadley Wickham
On Tue, Sep 26, 2023 at 2:01 AM Leonard Mada via R-package-devel wrote: > > Dear List-Members, > > There are no errors/warnings/notes when I run the check: > > ── R CMD check results > Rpdb 2.3.3 > Duration: 2m 50.1s > > 0 errors ✔ | 0

Re: [R-pkg-devel] How to fix Archived Package Rpdb?

2023-09-08 Thread Hadley Wickham
On Fri, Sep 8, 2023 at 6:02 AM Leonard Mada via R-package-devel wrote: > > Dear Members, > > I would like to reanimate the archived package Rpdb: > https://cran.r-project.org/web/packages/Rpdb/index.html > > 1.) I have tried to contact the original author by email, but got no > response. > > 2.)

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Hadley Wickham
Hi Michael, I can't help with S4, but I can help to make sure this isn't a problem with S7. What do you think of the current error message? Do you see anything obvious we could do to improve? library(S7) dbGetQuery <- new_generic("dbGetQuery", c("conn", "statement")) dbGetQuery(connection =

Re: [R-pkg-devel] LICENSE file in an R package for CRAN submission

2023-08-09 Thread Hadley Wickham
If you're using one of the licenses supported by usethis (https://usethis.r-lib.org/reference/licenses.html), you can just call the appropriate function and it will do all the setup required to be both CRAN and GitHub compatible. Hadley On Wed, Aug 9, 2023 at 10:10 AM Emanuele Cordano wrote: >

Re: [Rd] A demonstrated shortcoming of the R package management system

2023-08-08 Thread Hadley Wickham
Hi Dirk, Do you think it's worth also/instead considering a fix to S4 to avoid this caching issue in future R versions? (This is top of my for me as we consider the design of S7, and I recently made a note to ensure we avoid similar problems there:

Re: [R-pkg-devel] Feedback on "Using Rust in CRAN packages"

2023-07-13 Thread Hadley Wickham
> > If CRAN cannot trust even the official one of Rust, why does CRAN have Rust > > at all? > > > > I don't see the connection - if you downloaded something in the past it > doesn't mean you will be able to do so in the future. And CRAN has Rust > because it sounded like a good idea to allow

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Hadley Wickham
If it's internal only, you could change the name to levels_no()? Hadley On Mon, May 8, 2023 at 7:28 AM Ulrike Groemping wrote: > > Thanks, Duncan. I appreciate the view that levels.no acts as an S3 > method for the generic levels, if an object of class "no" is handed to > it. However, as the

Re: [R-pkg-devel] Acknowledging small functions from another package

2023-05-04 Thread Hadley Wickham
IMO those functions are so small that you don't need to call them out in your DESCRIPTION. Just note in a nearby comment where they came from. Hadley On Thu, May 4, 2023 at 3:21 AM David Hugh-Jones wrote: > > Hi, > > One of my packages copy-pasted some small functions (stuff like `%||%` for >

Re: [R-pkg-devel] Changing R Package Maintainer

2023-04-07 Thread Hadley Wickham
Just submit your package, and you'll get an automated email to the old address. Hadley On Sat, Apr 8, 2023 at 7:14 AM Andrew Simmons wrote: > > Hi, > > > I'm changing my name and my email address. I've got an update I'd like to > submit to CRAN, I've changed my name and email in my DESCRIPTION.

Re: [R-pkg-devel] Best way forward on a CRAN archived package

2022-10-16 Thread Hadley Wickham
I’d suggest resubmitting, after ensuring that R CMD check runs without any notes, warnings, or errors. Hadley On Monday, October 10, 2022, Diego Hernangómez Herrero < diego.hernangomezherr...@gmail.com> wrote: > Hi: > > I have some doubts on how to proceed in this case. I am the developer of >

Re: [R-pkg-devel] Issue handling datetimes: possible differences between computers

2022-10-10 Thread Hadley Wickham
On Sun, Oct 9, 2022 at 9:31 PM Jeff Newmiller wrote: > > ... which is why tidyverse functions and Python datetime handling irk me so > much. > > Is tidyverse time handling intrinsically broken? They have a standard > practice of reading time as UTC and then using force_tz to fix the "mistake".

Re: [R-pkg-devel] CRAN package isoband and its reverse dependencies

2022-10-05 Thread Hadley Wickham
Yes, we will make sure that this is fixed ASAP. There is no need to worry. Hadley On Wed, Oct 5, 2022 at 7:32 AM John Harrold wrote: > > Howdy Folks, > > I got a message from CRAN today telling me that I have a strong reverse > dependency on the isoband package. But I'm not alone! It look like

Re: [R-pkg-devel] Non-ASCII and CRAN Checks

2022-09-20 Thread Hadley Wickham
In my experience this NOTE does not interfere with CRAN submission and you can ignore it. Hadley On Monday, September 19, 2022, Igor L wrote: > Hello everybody, > > I'm testing my package with the devtools::check() function and I got a > warning about found non-ASCII strings. > > These

Re: [R-pkg-devel] [External] Re: What is a "retired"package?

2021-09-21 Thread Hadley Wickham
ply instead of plyr::aaply. > > -Original Message- > From: Hadley Wickham > Sent: Tuesday, September 21, 2021 11:48 AM > To: Lenth, Russell V > Cc: Jeff Newmiller ; r-package-devel@r-project.org > Subject: Re: [R-pkg-devel] [External] Re: What is a "retired"p

Re: [R-pkg-devel] [External] Re: What is a "retired"package?

2021-09-21 Thread Hadley Wickham
> But for the broader question, Jeff is saying that there really are 700 > packages that are in potential trouble! I think that's rather an overstatement of the problem — there's nothing wrong with plyr; it's just no longer under active development. If anything, plyr is one of the safest

Re: [R-pkg-devel] best LICENSE practices: AGPL-3 + LaTeX Project Public License

2021-07-15 Thread Hadley Wickham
On Wed, Jul 14, 2021 at 9:11 AM Ben Bolker wrote: > > >In the process of trying to get a package to build successfully on > r-hub's Fedora platform, I had to add a whole bunch of LaTeX .sty files > to the vignette directory. One of these was collectbox.sty, which > triggers the NOTE > > ---

Re: [R-pkg-devel] winUCRT failures

2021-04-25 Thread Hadley Wickham
Who is responsible for the winUCRT checks? Perhaps that person could provide us with a list of root causes behind the testthat failures, and we could look into resolving them. Hadley On Sun, Apr 25, 2021 at 7:50 AM Duncan Murdoch wrote: > > The current CRAN release of rgl fails on winUCRT

Re: [R-pkg-devel] winUCRT failures

2021-04-25 Thread Hadley Wickham
> One additional thought: > > If the testing package (i.e. testthat in this case) had been available > but other suggested packages were not, it would be worth running tests > with just testthat present: that might be why you called the decision > defensible. I'd agree with that. > > However,

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
On Monday, February 15, 2021, David Winsemius wrote: > > On 2/15/21 1:10 PM, Hadley Wickham wrote: > >> This is a nice example of the motivation for tidy evaluation — since >> enquo() captures the environment in which the promise should be >> evaluated, there's no need

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
This is a nice example of the motivation for tidy evaluation — since enquo() captures the environment in which the promise should be evaluated, there's no need for an additional explicit argument. library(rlang) replicate2 <- function (n, expr, simplify = "array") { exnr <- enquo(expr)

Re: [R-pkg-devel] Testing on old R versions

2021-01-31 Thread Hadley Wickham
On Sun, Jan 31, 2021 at 4:32 AM Duncan Murdoch wrote: > > I am trying out a modified version of the tidyverse actions, and it does > seem to be going well. Just one question: > > rgl has a soft dependency on alphashape3d, and alphashape3d has a hard > dependency on rgl. This means that I need

Re: [Rd] New pipe operator and gg plotz

2020-12-09 Thread Hadley Wickham
Another option is https://github.com/hadley/ggplot1 藍 Hadley On Wed, Dec 9, 2020 at 1:24 PM Duncan Murdoch wrote: > > Looks like Sergio Oller took your ambitious approach: > https://github.com/zeehio/ggpipe. It hasn't been updated since 2017, so > there may be some new things in ggplot2 that

Re: [Rd] New pipe operator

2020-12-08 Thread Hadley Wickham
I just wanted to pipe in here (HA HA) to say that I agree with Kevin. I've never loved the complicated magrittr rule (which has personally tripped me up a couple of times) and I think the compact inline function syntax provides a more general solution. It is a bit more typing, and it will require

Re: [R-pkg-devel] best practices for handling a mixed-licensed package

2020-10-03 Thread Hadley Wickham
ssuming you will also use them to parse the files in the package seems > rather less reasonable IMO when you have such a clear alternative > (packaging). > > On October 3, 2020 9:02:02 AM PDT, Dirk Eddelbuettel > wrote: > > > >On 3 October 2020 at 09:

Re: [R-pkg-devel] best practices for handling a mixed-licensed package

2020-10-03 Thread Hadley Wickham
On Fri, Oct 2, 2020 at 5:26 PM Dirk Eddelbuettel wrote: > > On 2 October 2020 at 14:44, Jeff Newmiller wrote: > | if you want clarity in the minds of _users_ I would beg you to split the > code into two packages. People will likely either be afraid of the GPL > bogey man and refrain from

Re: [Rd] Including full text of open source licenses in a package

2020-09-12 Thread Hadley Wickham
On Saturday, September 12, 2020, Hugh Parsonage wrote: > Perhaps I have misread that excerpt from WRE, but my read is that > package authors should not duplicate GNU COPYING, since it is present > in all R distributions already when using GPL-2 and friends. It > doesn't apply to packages

[Rd] Including full text of open source licenses in a package

2020-09-11 Thread Hadley Wickham
Hi all, R-exts currently requests that package authors don't include copies of standard licenses: > Whereas you should feel free to include a license file in your source > distribution, please do > not arrange to install yet another copy of the GNU COPYING or COPYING.LIB > files but > refer to

Re: [Rd] some questions about R internal SEXP types

2020-09-08 Thread Hadley Wickham
On Tue, Sep 8, 2020 at 4:12 AM Tomas Kalibera wrote: > > > The general principle is that R packages are only allowed to use what is > documented in the R help (? command) and in Writing R Extensions. The > former covers what is allowed from R code in extensions, the latter > mostly what is

Re: [Rd] object.size vs lobstr::obj_size

2020-03-27 Thread Hadley Wickham
On Fri, Mar 27, 2020 at 4:01 PM Hervé Pagès wrote: > > > On 3/27/20 12:00, Hadley Wickham wrote: > > > > > > On Fri, Mar 27, 2020 at 10:39 AM Hervé Pagès > <mailto:hpa...@fredhutch.org>> wrote: > > > > Hi Tomas, > > > >

Re: [Rd] object.size vs lobstr::obj_size

2020-03-27 Thread Hadley Wickham
On Fri, Mar 27, 2020 at 11:08 AM Tomas Kalibera wrote: > On 3/27/20 4:39 PM, Hervé Pagès wrote: > > Hi Tomas, > > > > On 3/27/20 07:01, Tomas Kalibera wrote: > >> they provide an over-approximation > > > > They can also provide an "under-approximation" (to say the least) e.g. > > on reference

Re: [Rd] object.size vs lobstr::obj_size

2020-03-27 Thread Hadley Wickham
On Fri, Mar 27, 2020 at 10:39 AM Hervé Pagès wrote: > Hi Tomas, > > On 3/27/20 07:01, Tomas Kalibera wrote: > > they provide an over-approximation > > They can also provide an "under-approximation" (to say the least) e.g. > on reference objects where the entire substance of the object is ignored

Re: [Rd] Rebuilding and re-checking of downstream dependencies on CRAN Mac build machines

2020-03-26 Thread Hadley Wickham
If I do install.packages("dplyr", type = "source"), I see: Installing package into ‘/Users/hadley/R’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/dplyr_0.8.5.tar.gz' Content type 'application/x-gzip' length 1378766 bytes (1.3 MB)

[R-pkg-devel] win-builder down?

2020-02-22 Thread Hadley Wickham
Hi all, Is win-builder down? I submitted a couple of packages >24 hours ago, and haven't heard back. Hadley -- http://hadley.nz __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-14 Thread Hadley Wickham
On Sun, Nov 10, 2019 at 2:37 AM Martin Maechler wrote: > > > Gabriel Becker > > on Sat, 2 Nov 2019 12:37:08 -0700 writes: > > > I agree that we can be careful and narrow and still see a > > nice improvement in behavior. While Herve's point is valid > > and I understand his

Re: [Rd] improving the performance of install.packages

2019-11-09 Thread Hadley Wickham
If this is the behaviour you are looking for, you might like to try pak (https://pak.r-lib.org) # Create a temporary library path <- tempfile() dir.create(path) .libPaths(path) pak::pkg_install("scales") #> → Will install 8 packages: #> colorspace (1.4-1), labeling (0.3), munsell (0.5.0), R6

Re: [Rd] Puzzled about a new method for "[".

2019-11-04 Thread Hadley Wickham
For what it's worth, I don't think this strategy can work in general, because a class might have attributes that depend on its data/contents (e.g. https://vctrs.r-lib.org/articles/s3-vector.html#cached-sum). I don't think these are particularly common in practice, but it's dangerous to assume that

Re: [R-pkg-devel] Require -package.Rd?

2019-09-30 Thread Hadley Wickham
On Tue, Sep 24, 2019 at 8:07 AM Georgi Boshnakov wrote: > > It is worth noting that > > help(package="") > > shows file -package.Rd, while > > help() > > shows topic "package". > > Topic -package.Rd is also printed at the top of the pdf manual, > while package.Rd follows the alphabetical

Re: [R-pkg-devel] OFFICIAL: R-devel check error: package or NAMESPACE load failed, there is no package called broom

2019-09-10 Thread Hadley Wickham
This works for me locally too, so I'd recommend trying win-devel again. Sometimes you catch it in an inconsistent state and your check fails for reasons unrelated to your package. Hadley On Sat, Sep 7, 2019 at 3:50 PM Georgina Anderson wrote: > > OFFICIAL > > Hi > > Any help with the following

Re: [R-pkg-devel] (Not) Reporting minimum R version in DESCRIPTION Depends Field

2019-07-30 Thread Hadley Wickham
ier versions, and you can't find a way to > enable its use on earlier versions, you can add the dependency in a > later release. > > Ben Bolker > > On 2019-07-26 10:20 a.m., Hadley Wickham wrote: > > I no longer believe this to be good advice - I think you should o

Re: [R-pkg-devel] (Not) Reporting minimum R version in DESCRIPTION Depends Field

2019-07-26 Thread Hadley Wickham
I no longer believe this to be good advice - I think you should only declare a specific dependency if you want to strongly assert that your package works with those versions. For example, all tidyverse versions depend on R 3.2 and later, because we test on all those versions. Hadley On Friday,

Re: [Rd] nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)

2019-05-16 Thread Hadley Wickham
The existing behaviour seems inutitive to me. I would consider these invariants for n vector x_i's each with size m: * nrow(rbind(x_1, x_2, ..., x_n)) equals n * ncol(rbind(x_1, x_2, ..., x_n)) equals m Additionally, wouldn't you expect rbind(x_1[i], x_2[i]) to equal rbind(x_1, x_2)[, i, drop =

Re: [R-pkg-devel] CRAN student assistants

2019-05-16 Thread Hadley Wickham
ackgrounds they have. Similarly, I don't want to know how much they are paid, just whether or not they are volunteers or employees. Hadley On Tue, May 14, 2019 at 10:23 AM Hadley Wickham wrote: > > Hi all, > > Several people on my team have received responses to their CRAN > submissions fr

[R-pkg-devel] CRAN student assistants

2019-05-14 Thread Hadley Wickham
Hi all, Several people on my team have received responses to their CRAN submissions from new members of the CRAN team who appear to be student assistants (judging from their job titles: "Studentischer administrativer Mitarbeiter"). From the outside, they appear to be exercising editorial

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-28 Thread Hadley Wickham
On Wed, Mar 27, 2019 at 6:27 PM Abs Spurdle wrote: > > > the prison made by ancient design choices > > That prison of ancient design choices isn't so bad. > > I have no further comments on object oriented semantics. > However, I'm planning to follow the following design pattern. > > If I set the

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-27 Thread Hadley Wickham
I would recommend reading https://adv-r.hadley.nz/base-types.html and https://adv-r.hadley.nz/s3.html. Understanding the distinction between base types and S3 classes is very important to make this sort of question precise, and in my experience, you'll find R easier to understand if you carefully

Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled

2019-03-07 Thread Hadley Wickham
As of ~7 hours ago, the warning is suppressed: https://github.com/wch/r-source/commit/31ee14c620eb1b939acd322f3b5617f998aab8e8 (But the service still doesn't work) Hadley On Thu, Mar 7, 2019 at 11:03 AM Hadley Wickham wrote: > > It appears that the code was added by BDR on 2 Sep 2018: &

Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled

2019-03-07 Thread Hadley Wickham
It appears that the code was added by BDR on 2 Sep 2018: https://github.com/wch/r-source/commit/d839b1e04e173f90b51ad809ef0bdb18095abe6f I assume we are seeing failing R CMD check results because http://worldclockapi.com/api/json/utc/now has recently died. It would be appreciated if someone from

Re: [R-pkg-devel] submitting to github

2019-01-25 Thread Hadley Wickham
No one else has mentioned it on the thread, so I'd highly recommend https://happygitwithr.com — it's a guide to git + github specifically written for R users, and covers many of the common problems people have when getting set up. Hadley On Fri, Jan 25, 2019 at 2:51 AM Troels Ring wrote: > >

Re: [R-pkg-devel] New CRAN internet policy

2018-12-21 Thread Hadley Wickham
On Fri, Dec 7, 2018 at 2:48 AM Martin Maechler wrote: > > >>>>> Hadley Wickham > >>>>> on Thu, 6 Dec 2018 10:22:47 -0600 writes: > > > Hi all, > > I'd love to get some clarification on what the new internet policy > >

Re: [R-pkg-devel] Package update submission to CRAN fails on pretest

2018-12-08 Thread Hadley Wickham
You might try reinstalling devtools and dependencies - there was unfortunately a brief combination of versions that lead to build() failing to overwrite existing files. Hadley On Fri, Dec 7, 2018 at 10:46 AM Wolfgang Lenhard wrote: > > Many thanks for the remark. It seems, it has something to do

Re: [R-pkg-devel] Suggested package relies on recent R

2018-12-08 Thread Hadley Wickham
Can you just set _R_CHECK_FORCE_SUGGESTS_=false? env: global: # don't treat missing suggested packages as error - _R_CHECK_FORCE_SUGGESTS_=false I am reasonably certain that is what CRAN uses. Hadley On Fri, Dec 7, 2018 at 9:11 AM David Hugh-Jones wrote: > > Hi, > > My package Suggests

Re: [R-pkg-devel] New CRAN internet policy

2018-12-06 Thread Hadley Wickham
one point me to where all the policies such as this one are posted. > This may affect a package I have, and one problem I have is different people > have differing ideas of what defines a "graceful" exit. > > Thanks, > > Roy > > > > On Dec 6, 2018, at 8:22 AM

Re: [R-pkg-devel] creating a link to a vignette in a .Rd file

2018-11-20 Thread Hadley Wickham
> None of these solutions seem perfect to me. I think that my suggestion is the > most natural, but as you point out it won’t work in all contexts. Perhaps the > safest approach is to give the vignette() command in the text of the help > file, one of your suggestions. If you do that, and you

Re: [R-pkg-devel] creating a link to a vignette in a .Rd file

2018-11-19 Thread Hadley Wickham
On Mon, Nov 19, 2018 at 4:49 PM Fox, John wrote: > > Dear r-package-devel list members, > > I'd like to create a link to a package vignette from a help file in the same > package, for example to the "partial-residuals" vignette in the effects > package from effect.Rd. I'm able to generate a URL

[Rd] An update on the vctrs package

2018-11-05 Thread Hadley Wickham
Hi all, I wanted to give you an update on vctrs () since I last bought it up here in August. The biggest change is that I now have a much clearer idea of what vctrs is! I’ll summarise that here, and point you to the documentation if you’re interested in learning more.

Re: [R-pkg-devel] Extending/adding to an R6 class from another package: qns

2018-10-19 Thread Hadley Wickham
> AzureRMR: the "base" package, provides a number of R6 classes > AzureVM: a "child" package that extends classes from AzureRMR with extra > functionality related to virtual machines > AzureStor: another child package that extends classes from AzureRMR, this > time for storage accounts > Etc. >

Re: [R-pkg-devel] stringi update

2018-09-15 Thread Hadley Wickham
Looking at the primary CRAN site: https://cran.r-project.org/web/packages/stringi/index.html, you can see that the windows binary is still at 1.1.7, suggesting that there's some build failure. You can see exactly what that is on the CRAN check page:

Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-07 Thread Hadley Wickham
On Fri, Sep 7, 2018 at 9:13 AM Iñaki Ucar wrote: > > El vie., 7 sept. 2018 a las 16:03, Ralf Stubner > () escribió: > > > > On 07.09.2018 15:52, Iñaki Ucar wrote: > > > For the record, this is what the testthat paper in the R Journal says: > > > > > > "[...] I recommend storing your tests in

Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-06 Thread Hadley Wickham
On Wed, Sep 5, 2018 at 3:03 PM Duncan Murdoch wrote: > > On 05/09/2018 2:20 PM, Henrik Bengtsson wrote: > > I take a complementary approach; I condition on, my home-made, > > R_TEST_ALL variable. Effectively, I do: > > > > if (as.logical(Sys.getenv("R_TEST_ALL", "FALSE"))) { > > ... > > } >

Re: [Rd] True length - length(unclass(x)) - without having to call unclass()?

2018-09-02 Thread Hadley Wickham
For the new vctrs::records class, I implemented length, names, [[, and [[<- myself in https://github.com/r-lib/vctrs/blob/master/src/fields.c. That lets me override the default S3 methods while still being able to access the underlying data that I'm interested in. Another option that avoids (that

Re: [Rd] build package with unicode (farsi) strings

2018-08-30 Thread Hadley Wickham
On Thu, Aug 30, 2018 at 2:11 AM Thierry Onkelinx wrote: > > Dear Farid, > > Try using the ASCII notation. letters_fa <- c("\u0627", "\u0641"). The full > code table is available at https://www.utf8-chartable.de It's a little easier to do this with code: letters_fa <-

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Hadley Wickham
On Thu, Aug 30, 2018 at 10:58 AM Martin Maechler wrote: > > > Joris Meys > > on Thu, 30 Aug 2018 14:48:01 +0200 writes: > > > On Thu, Aug 30, 2018 at 2:09 PM Dénes Tóth > > wrote: > >> Note that `||` and `&&` have never been symmetric: > >> > >> TRUE || stop() #

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Hadley Wickham
I think this is an excellent idea as it eliminates a situation which is almost certainly user error. Making it an error would break a small amount of existing code (even if for the better), so perhaps it should start as a warning, but be optionally upgraded to an error. It would be nice to have a

Re: [Rd] Where does L come from?

2018-08-29 Thread Hadley Wickham
Thanks for the great discussion everyone! Hadley On Sat, Aug 25, 2018 at 8:26 AM Hadley Wickham wrote: > > Hi all, > > Would someone mind pointing to me to the inspiration for the use of > the L suffix to mean "integer"? This is obviously hard to google for, > a

Re: [Rd] conflicted: an alternative conflict resolution strategy

2018-08-29 Thread Hadley Wickham
>> conflicted applies a few heuristics to minimise false positives (at the >> cost of introducing a few false negatives). The overarching goal is to >> ensure that code behaves identically regardless of the order in which >> packages are attached. >> >> - A number of packages provide a function

[Rd] Where does L come from?

2018-08-25 Thread Hadley Wickham
Hi all, Would someone mind pointing to me to the inspiration for the use of the L suffix to mean "integer"? This is obviously hard to google for, and the R language definition (https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Constants) is silent. Hadley -- http://hadley.nz

Re: [Rd] conflicted: an alternative conflict resolution strategy

2018-08-24 Thread Hadley Wickham
On Fri, Aug 24, 2018 at 4:28 AM Joris Meys wrote: > > Dear Hadley, > > There's been some mails from you lately about packages on R-devel. I would > argue that the appropriate list for that is R-pkg-devel, as I've been told > myself not too long ago. People might get confused and think this is

Re: [Rd] conflicted: an alternative conflict resolution strategy

2018-08-24 Thread Hadley Wickham
On Thu, Aug 23, 2018 at 3:46 PM Duncan Murdoch wrote: > > First, some general comments: > > This sounds like a useful package. > > I would guess it has very little impact on runtime efficiency except > when attaching a new package; have you checked that? It adds one extra element to the search

[Rd] conflicted: an alternative conflict resolution strategy

2018-08-23 Thread Hadley Wickham
Hi all, I’d love to get your feedback on the conflicted package, which provides an alternative strategy for resolving ambiugous function names (i.e. when multiple packages provide identically named functions). conflicted 0.1.0 is already on CRAN, but I’m currently preparing a revision

Re: [R-pkg-devel] CRAN incoming queue closed from Sep 1 to Sep 9

2018-08-14 Thread Hadley Wickham
Does this include automatically (bot) accepted submissions? Hadley On Tue, Aug 14, 2018 at 8:07 AM Uwe Ligges wrote: > > Dear package developers, > > the CRAN incoming queue will be closed from Sep 1 to Sep 9. Hence > package submissions are only possible before and after that period. > > Best, >

Re: [Rd] substitute() on arguments in ellipsis ("dot dot dot")?

2018-08-13 Thread Hadley Wickham
Since you're already using bang-bang ;) library(rlang) dots1 <- function(...) as.list(substitute(list(...)))[-1L] dots2 <- function(...) as.list(substitute(...())) dots3 <- function(...) match.call(expand.dots = FALSE)[["..."]] dots4 <- function(...) exprs(...) bench::mark( dots1(1+2, "a",

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-09 Thread Hadley Wickham
On Thu, Aug 9, 2018 at 4:26 PM jan Vitek wrote: > > > I'm now confident that I > > can avoid using "type" by itself, and instead always use it in a > > compound phrase (like type system) to avoid confusion. That leaves the > > `.type` argument to many vctrs functions. I'm considering change it to

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-09 Thread Hadley Wickham
> > As Gabe mentioned (and you've explained about) the term "type" > > is really confusing here. As you know, the R internals are all > > about SEXPs, TYPEOF(), etc, and that's what the R level > > typeof(.) also returns. As you want to use something slightly > > different, it should be

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-09 Thread Hadley Wickham
On Thu, Aug 9, 2018 at 7:54 AM Joris Meys wrote: > > Hi Hadley, > > my point actually came from a data analyst point of view. A character > variable is something used for extra information, eg the "any other ideas?" > field of a questionnaire. A categorical variable is a variable describing >

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-09 Thread Hadley Wickham
On Thu, Aug 9, 2018 at 3:57 AM Joris Meys wrote: > > I sent this to Iñaki personally by mistake. Thank you for notifying me. > > On Wed, Aug 8, 2018 at 7:53 PM Iñaki Úcar wrote: > > > > > For what it's worth, I always thought about factors as fundamentally > > characters, but with

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-08 Thread Hadley Wickham
>> So we say that a >> factor `x` has finer resolution than factor `y` if the levels of `y` >> are contained in `x`. So to find the common type of two factors, we >> take the union of the levels of each factor, given a factor that has >> finer resolution than both. > > I'm not so sure. I think a

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-08 Thread Hadley Wickham
> > I now have a better argument, I think: > > > If you squint your brain a little, I think you can see > > that each set of automatic coercions is about increasing > > resolution. Integers are low resolution versions of > > doubles, and dates are low resolution versions of >

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-08 Thread Hadley Wickham
>>> Method dispatch for `vec_c()` is quite simple because associativity and >>> commutativity mean that we can determine the output type only by >>> considering a pair of inputs at a time. To this end, vctrs provides >>> `vec_type2()` which takes two inputs and returns their common type >>>

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-06 Thread Hadley Wickham
t to emphasise that it's a type system, not a oo system, in that coercions are not defined by superclass/subclass relationships. > More thoughts inline. > > On Mon, Aug 6, 2018 at 9:21 AM, Hadley Wickham wrote: >> >> Hi all, >> >> I wanted to share with you an experimental

[Rd] vctrs: a type system for the tidyverse

2018-08-06 Thread Hadley Wickham
Hi all, I wanted to share with you an experimental package that I’m currently working on: vctrs, . The motivation for vctrs is to think deeply about the output “type” of functions like `c()`, `ifelse()`, and `rbind()`, with an eye to implementing one strategy

Re: [Rd] Is NULL a vector?

2018-07-23 Thread Hadley Wickham
On Mon, Jul 23, 2018 at 2:17 PM, Duncan Murdoch wrote: > On 23/07/2018 3:03 PM, Hadley Wickham wrote: >> >> Hi all, >> >> Would you generally consider NULL to be a vector? > > > According to the language definition (in the doc directory), it is not: > &

[Rd] Is NULL a vector?

2018-07-23 Thread Hadley Wickham
Hi all, Would you generally consider NULL to be a vector? Base R functions are a little inconsistent: ## In favour ``` r identical(as.vector(NULL), NULL) #> [1] TRUE identical(as(NULL, "vector"), NULL) #> [1] TRUE # supports key vector vector generics length(NULL) #> [1] 0 NULL[c(3, 4, 5)] #>

Re: [Rd] Testing for vectors

2018-07-08 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 11:19 PM, Gabe Becker wrote: > Hadley, > > > On Sat, Jul 7, 2018 at 1:32 PM, Hadley Wickham wrote: >> >> On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: >> > Hadley, >> > >> >> >> >> I was thinking

Re: [Rd] Testing for vectors

2018-07-08 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 3:48 PM, Ott Toomet wrote: > Thanks, Hadley for bringing this up:-) > > I am teaching R and I can suggest 5 different definitions of 'vector': > > a) vector as a collection of homogeneous objects, indexed by [ ] (more > precisely atomic vector). Sometimes you hear that in

Re: [Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: > Hadley, > >> >> I was thinking primarily of completing the set of is.matrix() and >> is.array(), or generally, how do you say: is `x` a 1d dimensional >> thing? > > > Can you clarify what you mean by dimensionality sense and specifically 1d >

Re: [Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 12:54 PM, Duncan Murdoch wrote: > On 07/07/2018 1:20 PM, Hadley Wickham wrote: >> >> Hi all, >> >> Is there are base function that I've missed that tests if an object is >> a vector in the dimensionality sense, rather than the data s

[Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
Hi all, Is there are base function that I've missed that tests if an object is a vector in the dimensionality sense, rather than the data structure sense? i.e. something that checks is.null(dim(x)) ? is.vector() is trivially disqualified since it also checks for the presence of non-names

Re: [R-pkg-devel] Weird error on CRAN linux check

2018-07-04 Thread Hadley Wickham
I don't think it's related to the error, but you shouldn't be exporting this: export("align<-.huxtable") You should generally only export the method. Hadley On Wed, Jul 4, 2018 at 9:00 AM, David Hugh-Jones wrote: > Hi all, > > The following shows an error for my package: >

Re: [R-pkg-devel] Errors from Suggests or Enhances not in mainstream repositories

2018-07-03 Thread Hadley Wickham
On Tue, Jul 3, 2018 at 5:57 AM, Duncan Murdoch wrote: > On 02/07/2018 6:13 PM, Ben Bolker wrote: >> >> I got something similar. I have a few thoughts: >> >> (1) you should use "if (require(citrus)) { ... }" in your examples; >> "Suggests" and "Enhances" packages are supposed to be *optional*,

Re: [Rd] Subsetting the "ROW"s of an object

2018-06-08 Thread Hadley Wickham
On Fri, Jun 8, 2018 at 2:09 PM, Berry, Charles wrote: > > >> On Jun 8, 2018, at 1:49 PM, Hadley Wickham wrote: >> >> Hmmm, yes, there must be some special case in the C code to avoid >> recycling a length-1 logical vector: > > > Here is a version that (I

Re: [Rd] Subsetting the "ROW"s of an object

2018-06-08 Thread Hadley Wickham
s 46.3ms On Fri, Jun 8, 2018 at 12:31 PM, Berry, Charles wrote: > > >> On Jun 8, 2018, at 11:52 AM, Hadley Wickham wrote: >> >> On Fri, Jun 8, 2018 at 11:38 AM, Berry, Charles wrote: >>> >>> >>>> On Jun 8, 2018, at 10:37 AM, Hervé Pagè

Re: [Rd] Subsetting the "ROW"s of an object

2018-06-08 Thread Hadley Wickham
matrix(raw(0), nrow = 5, ncol = 0)[1:3, TRUE] : >>(subscript) logical subscript too long > > OK. But this is easy enough to handle. > >> >> H. >> >> On 06/08/2018 10:29 AM, Hadley Wickham wrote: >>> I suspect this will have suboptimal performance since the

Re: [Rd] Subsetting the "ROW"s of an object

2018-06-08 Thread Hadley Wickham
I suspect this will have suboptimal performance since the TRUEs will get recycled. (Maybe there is, or could be, ALTREP, support for recycling) Hadley On Fri, Jun 8, 2018 at 10:16 AM, Berry, Charles wrote: > > >> On Jun 8, 2018, at 8:45 AM, Hadley Wickham wrote:

  1   2   3   4   5   6   7   8   >