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] 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] 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