I have written a function (see below) which encloses a boxplot. My function "xbox" takes in a variable name (such as "age"), and do a boxplot. Now I would like to add a title for the graph dynamically displaying the variable name as part of title.
But, in reality, the title displays VALUES of my variable. Obviously, sprintf does not work. Can somebody shed light on how to solve my problem in properly displaying a title ? Thanks. ----------------------------------------------------------------- xbox<- function(X) { boxplot(_expenses ~ X, data=my_tab,main=sprintf("title is %s",X)) } xbox(age) -- View this message in context: http://n4.nabble.com/How-to-dynamically-display-title-for-a-graph-tp998365p998365.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.