[R] as.character.call?

Spencer Graves spencer.graves at structuremonitoring.com
Wed Jun 4 05:07:50 CEST 2014


       How can I get a call object as a character string?


Example:

 > cl <- quote(round(10.5))
 > str(cl)
  language round(10.5)
 > as.character(cl)
[1] "round" "10.5"


       How can I get "round(10.5)"?


        I can get this answer for this toy problem with 
paste0(paste(as.character(cl), collapse='('), ')').  However, that's not 
a general solution.


       Thanks,
       Spencer



More information about the R-help mailing list