Displaying 1 result from an estimated 1 matches for "myguess".
Did you mean:
myguest
2013 Jan 09
1
deparse substitute
...;m writing a function that needs the input names (as characterstrings) as part of the output.
With deparse(substitute( ) ) that works fine, until I replace all zeros with 0.001 (log is calculated at some time):
tf <- function(input) { input[input==0] <- 0.001 ; deparse(substitute(input)) }
myguess <- 42
tf(myguess) # not "myguess", but "42"
Now when I extract the input names before replacing the zeros, this works:
tf <- function(input) { out <- deparse(substitute(input)) ; input[input==0] <- 0.001 ; out }
tf(myguess) # correct: "myguess&quo...