[R] How to coerce an object name to character vector?

Антон Морковин a-morkovin at yandex.ru
Mon Dec 9 22:14:38 CET 2013


   For example, I have a numeric vector named "d" (without any attributes) and
   I want to coerce it to character vector "d". Is there any such functions? I
   need  it  to make a function which applies other functions to objects,
   something like this:

   do<-function(x,fun, ...) {
   fun<-match.fun(fun)
   assign(as.character(quote(x)),fun(x, ...))
   }

   But, of course, quote(x) always return just "x", not the name of object.

   Thanks for help!

   ______

   цЁ ц∙ц≈ц│ц√ц┘ц▌ц┴ц┘ц█,
   ц║.ц║. ц╜ц▐ц▓ц▀ц▐ц≈ц┴ц▌


More information about the R-help mailing list