From spencer.graves at prodsyse.com  Mon Jan  9 10:53:20 2017
From: spencer.graves at prodsyse.com (Spencer Graves)
Date: Mon, 9 Jan 2017 03:53:20 -0600
Subject: [Rd] problem with print.generic(x)deparse(substitute(x))
Message-ID: <f96d2039-6760-6cff-c42d-bda85015f7e0@prodsyse.com>

Hi, All:


       I'm having trouble getting deparse(substitute(x)) inside 
print.generic to consistently


       I'm having trouble getting a print.something to work 
consistently.  Consider the following toy example:


# Define an object of class 'dum'
k <- 1
class(k) <- 'dum'
str(k) # as expected

# Define print.dum
print.dum <- function(x, ...)
   deparse(substitute(x))

print(k) # Prints "k" as expected
#####**** THE FOLLOWING PRINTS NOTHING:
k # Why?


### Thanks,
### Spencer Graves

sessionInfo()

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.2

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils
[5] datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.3.2



[Rd] problem with print.generic(x)deparse(substitute(x))
Spencer Graves