Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed? A minimal example: meanF...
#3: Post edited
- I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed?
- A minimal example:
- ```
- meanFUN <- function(x) {
- mean(x, na.rm = TRUE)
- }
- ```
How can I assign the result from `mean(x, na.rm = TRUE)` from within the function to the global environment?
- I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed?
- A minimal example:
- ```
- meanFUN <- function(x) {
- mean(x, na.rm = TRUE)
- }
- ```
- How can I assign the result from `mean(x, na.rm = TRUE)` from within the function to the global environment?
#2: Post edited
- I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed?
- A minimal example:
- ```
- meanFUN <- function(x) {
- mean(x, na.rm = TRUE)
- }
- ```
How can I assign the result from `mean(x, na.rm = TRUE)` from within the function to the global environment?
- I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed?
- A minimal example:
- ```
- meanFUN <- function(x) {
- mean(x, na.rm = TRUE)
- }
- ```
- How can I assign the result from `mean(x, na.rm = TRUE)` from within the function to the global environment?
#1: Initial revision
How can I assign the result of an operation from within a function to the global environment?
I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed? A minimal example: ``` meanFUN <- function(x) { mean(x, na.rm = TRUE) } ``` How can I assign the result from `mean(x, na.rm = TRUE)` from within the function to the global environment?