Re: [R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Tiago Olivoto
Dear all, Thanks all for the tips and sorry for the automatic reply. Best regards, Olivoto Em qui., 4 de jan. de 2024 às 18:00, Iris Simmons escreveu: > You cannot and should not ignore this. > > An R package should never ever be assigning variables into environments > for which they haven't

Re: [R-pkg-devel] [Rd] static html vignette

2024-01-04 Thread Adrian Dușa
On Thu, Jan 4, 2024 at 10:44 PM Uwe Ligges wrote: > On 04.01.2024 21:23, Duncan Murdoch wrote:[...] > > Users aren't forced to install "Suggests" packages. That's a choice > > they make. The default for `install.packages()` is `dependencies = NA`, > > which says to install hard dependencies

Re: [R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Josiah Parry
Alternatively, you can create a new environment in your package and assign into it and fetch out of it. This is definitely safer and probably "more idiomatic." Hope that helps! # create a new environment

Re: [R-pkg-devel] [Rd] static html vignette

2024-01-04 Thread Josiah Parry
I understand that this doesn't actually *solve *your problem, but would like to offer an alternative perspective. I often find that vignettes may be most useful as an extended form of documentation. If you have a pkgdown site, you can use `usethis::use_article()` to create an article which will

Re: [R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Duncan Murdoch
On 04/01/2024 3:51 p.m., Tiago Olivoto wrote: Hi everyone! I which a happy new year! I'm coding a shiny app and I would like to include an option so that the users can assign the results to the global environment for further analysis. I have written the following code, which checks if

Re: [R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Iris Simmons
You cannot and should not ignore this. An R package should never ever be assigning variables into environments for which they haven't been granted permission to do so. You should ask the user whether they want the object assigned in the global environment before doing so, and the default should

[R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Tiago Olivoto
Hi everyone! I which a happy new year! I'm coding a shiny app and I would like to include an option so that the users can assign the results to the global environment for further analysis. I have written the following code, which checks if 'globalvarname' (the name of object to be created in

Re: [R-pkg-devel] [Rd] static html vignette

2024-01-04 Thread Uwe Ligges
On 04.01.2024 21:23, Duncan Murdoch wrote: On 04/01/2024 11:43 a.m., Adrian Dușa wrote: > (Moved here following Ivan's suggestion) > > On Thu, Jan 4, 2024 at 12:55 PM Ivan Krylov wrote: > >> On Thu, 4 Jan 2024 11:57:15 +0200 >> Adrian Dușa wrote: >> >>> I wonder if it would be

Re: [R-pkg-devel] [Rd] static html vignette

2024-01-04 Thread Duncan Murdoch
On 04/01/2024 11:43 a.m., Adrian Dușa wrote: > (Moved here following Ivan's suggestion) > > On Thu, Jan 4, 2024 at 12:55 PM Ivan Krylov wrote: > >> On Thu, 4 Jan 2024 11:57:15 +0200 >> Adrian Dușa wrote: >> >>> I wonder if it would be possible to include an html static vignette. >> >> I would

Re: [R-pkg-devel] [Rd] static html vignette

2024-01-04 Thread Adrian Dușa
(Moved here following Ivan's suggestion) On Thu, Jan 4, 2024 at 12:55 PM Ivan Krylov wrote: > On Thu, 4 Jan 2024 11:57:15 +0200 > Adrian Dușa wrote: > > > I wonder if it would be possible to include an html static vignette. > > I would say that static vignettes are against the spirit of