Displaying 1 result from an estimated 1 matches for "printcomponent".
2005 Jan 26
2
string evaluation
Hello,
I would like to be able to compose an expression using some of the arguments I give to a function, that is assuming I have a list such as:
my.list<-list(A=1:3,B=c("Brave", "new", "world"))
and a function
printComponent<-function(component){
if (component=="A"||component=="B"){
my.expression<-paste("my.list",component,sep="$")
print(my.expression)}
else{cat("Wrong argument, must be A or B")}
}
I would like that a call "printCompo...