Re: [R-pkg-devel] preventing auto-update of R and c2d4u r-cran-* packages on Ubuntu 22.04

2023-08-10 Thread Neal Fultz
In the past, I've extracted the pre-built debian packages into the user's personal folder, instead of installing them via apt. It worked (but it was not fun), and was pretty manual. That might interact a bit better with some of the third party tools for dealing with dependencies in shiny apps, com

Re: [R-pkg-devel] Package internal function / Undocumented code objects warning

2023-02-24 Thread Neal Fultz
If it's an internal-only function check if it's exported in your NAMESPACE file. On Fri, Feb 24, 2023 at 1:12 PM EcoC2S - Irucka Embry wrote: > Greetings, I am attaching the complete R file for your review. The > vlookup_internal function and all of the functions in the package are > derived fro

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

2022-09-19 Thread Neal Fultz
This happened to me this summer when working on the recent US census; came up with two possible solutions: 1. Re-encode the column to UTF-8. Example: Encoding(puertoricocounty20$NAME) <- "latin1" puertoricocounty20$NAME <- iconv(puertoricocounty20$NAME, "latin1", "UTF-8") 2. Use gsub to replace

Re: [R-pkg-devel] nit-picking about CRAN repository policy

2022-05-11 Thread Neal Fultz
Is there a status code I could use to signal early-stopping due to missing dependencies (eg in test scripts)? I am thinking of writing something like: require(suggested_pkg) || quit(status=13) I checked ?quit which says: Some error status values are used by R itself. The default error

Re: [R-pkg-devel] Question about package dependency

2020-12-22 Thread Neal Fultz
Unless there is something Oracle-specific for your database code, I'd recommend using the DBI interface instead - "enterprise" users can provide an Oracle object to your functions, and other people could use their own particular databases. DBI itself could be a Suggests dependency if it isn't stri

Re: [R-pkg-devel] Accessing features in R4.0.

2020-12-16 Thread Neal Fultz
IIRC some packages use get() instead of double-colon to suppress the NOTE. I would probably ignore it myself. On Wed, Dec 16, 2020 at 8:29 AM Colin Gillespie wrote: > > Hi, > > I'm planning on using the tools::R_user_dir function in a package. But > for obvious reasons, I don't want to set the d

Re: [R-pkg-devel] Anyone Know How To Setup Wine for Windows Testing?

2020-07-15 Thread Neal Fultz
If you don't mind multi-gig docker containers, this can be helpful: https://github.com/scottyhardy/docker-wine It doesn't work with 64 bit versions of R as far as I could tell, but 32 bit did install and start correctly in a few clicks when I tried last year. On Wed, Jul 15, 2020 at 10:56 AM

Re: [R-pkg-devel] package CatDataAnalysis

2020-06-28 Thread Neal Fultz
I'm not sure exactly what cran is asking for, but the wooldridge package is a good example of a text book data set package, so maybe you can use the same format they did. https://cran.r-project.org/web/packages/wooldridge/index.html Best, Neal On Sun, Jun 28, 2020 at 9:08 AM Charles Geyer wrot

Re: [R-pkg-devel] Two packages with the same generic function

2020-06-22 Thread Neal Fultz
Another decent alternative is to submit the generic function to the `generics` package - https://github.com/r-lib/generics - or create your own API package. Both package A and B can import the generic from it, and everything works fine. It may also reduce your dependencies and/or build time. This

[R-pkg-devel] Setting graphics device-copy parameters

2020-06-17 Thread Neal Fultz
I'm working on a graphics device in a R package, and need to set some graphical parameters for text / labels on the devices as they are initialized or reset. This feature is described in R Internals: > The three copies of the GPar structure are used to store the current > parameters (accessed vi

Re: [R-pkg-devel] Forward function call

2020-06-08 Thread Neal Fultz
You will first need to convert the function call to an expression, then you can modify the expression as appropriate. Here's a somewhat contrived minimal example: > f <- function(z, ...) match.call() > aaa = f(a=1,2,3) > str(aaa) language f(z = 2, a = 1, 3) > aaa <- as.expression(aaa) > str(aaa)

[R-pkg-devel] Need help testing for Apple

2020-03-11 Thread Neal Fultz
plot", "osc1337") Try running it from a shell, and also inside screen and tmux, and let me know if you see the barplot in each case. Version numbers might be helpful too. *** it does not work in rstudio *** Thanks much! - Neal Fultz PS If anyone from rstudio is on the l

Re: [R-pkg-devel] .Fortran opinion

2019-05-26 Thread Neal Fultz
I think the current best practice is to wrap the Fortran code in a C helper, and invoke that using .Call - more information on that is available in Hadley's book - http://adv-r.had.co.nz/C-interface.html It shouldn't be too much work, maybe another 10-20 lines of code, most of which could probably

[R-pkg-devel] What to do when a dependency falls off CRAN

2019-03-24 Thread Neal Fultz
ation" code instead of the "library" code - also sounds tedious, days instead of weeks, but more likely to be billable. This topic has come up a few times in the past, but I would like to hear your current opinions given that CRAN is much more rigorous and automated now. v/r Neal

Re: [R-pkg-devel] size of package and splitting into 2

2019-01-14 Thread Neal Fultz
If you re-exported all the psychTools functions from psych, I doubt a typical user would notice or care. For example, this is how dplyr split out some of it's functions in to another package: https://github.com/tidyverse/dplyr/blob/master/R/reexport-tidyselect.R On Mon, Jan 14, 2019 at 9:03 AM Wil

Re: [R-pkg-devel] Question: Download package JAR from Github URL to /inst/java in an R package

2018-10-25 Thread Neal Fultz
Hi Marina - several of the AWR packages for using the AWS java sdk are implemented this way. For example: https://gitlab.com/daroczig/AWR/blob/master/R/zzz.R#L18 Best, -Neal On Thu, Oct 25, 2018 at 4:45 AM Maria Cristina Heredia Gómez < mrcrstnherediag...@gmail.com> wrote: > Hi everyone! > >

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Neal Fultz
In the estimatr package, we provided a shim to support broom without transitively depending on the tidyverse: tidy <- function(object, ...) { if (requireNamespace("broom", quietly = TRUE)) broom::tidy(object, ...) else UseMethod("tidy") } https://github.com/DeclareDesign/estimatr/blob/master/R

Re: [R-pkg-devel] Strange Additional_repositories NOTE followed by package install error

2018-02-05 Thread Neal Fultz
It looks like the drat repo you linked to only has windows binaries for 3.2, which is probably too old for win builder? Just a guess. On Mon, Feb 5, 2018 at 11:28 AM, Hugh Parsonage wrote: > I am unable to reproduce a recent R CMD check failure on CRAN > concerning a package of mine: grattan. >

[R-pkg-devel] Where do demos fit in?

2017-10-19 Thread Neal Fultz
A graduate student just asked me (copied below), in response to a bug I wrote ( https://github.com/DeclareDesign/estimatr/pull/38/commits/99e82e253979d1307714632e9dc05d2e2c9c66df ): How do demos normally relate to tests and vignettes? Is the purpose simply > to have manually run tests that check t

Re: [R-pkg-devel] Only printing a message once per top-level call.

2016-10-24 Thread Neal Fultz
I would point you at last.warning, but also note that it says this in ?warnings: Warning: It is undocumented where 'last.warning' is stored nor that it is visible, and this is subject to change. But it does seem like you could test if your warning was already in there, eg mywarnings

Re: [R-pkg-devel] no visible global function definition

2015-06-29 Thread Neal Fultz
There's https://twitter.com/cranpolicywatch I wouldn't mind if that got forwarded to r-package-devel, as I'm not on twitter myself. On Mon, Jun 29, 2015 at 10:09 AM, Kevin Ushey wrote: > Hi Uwe, > > It seems like this is quite a major change; I imagine it will affect many > packages (since lo

Re: [R-pkg-devel] appropriate directory for data downloads in examples, demos and vignettes

2015-06-29 Thread Neal Fultz
I would use tempfile() instead of /tmp/. That should create a file/directory that will get cleaned up when the R session ends, instead of when the machine reboots. AFAIK it also works on windows. On Mon, Jun 29, 2015 at 8:25 AM, Jonathan Callahan < jonat...@mazamascience.com> wrote: > Hi, > > The

Re: [R-pkg-devel] Keeping secrets in R packages

2015-06-07 Thread Neal Fultz
be > able to claim that they just accidentally saw it). This is fairly > quick, easy, and self contained in the package. > > On Fri, Jun 5, 2015 at 4:19 PM, Neal Fultz wrote: > > I am working on updating the RGoogleDocs package to use OAuth2, since the > > old api was rece

[R-pkg-devel] Keeping secrets in R packages

2015-06-05 Thread Neal Fultz
; place to store the secret? I would strongly prefer not requiring my end users to have to sign up for their own google API keys, but I also do not want to store the secret in the clear. Any suggestions on best practices? -Neal Fultz [[alternative HTML versi

Re: [R-pkg-devel] Extending MIT software

2015-05-28 Thread Neal Fultz
IANAL, but if you are just importing or depending on another package, you shouldn't need to worry about this. If you copied their code into your own package, you should probably rethink your approach. At my job, several of my coworkers had copy/pasted code from stack overflow, which carries a CC l