Hi there, I'm very new on R and I hope someone can help me to solve the problem in using the ifelse statement with the xtable function(library xtable). I'm trying to get the printing of the elements of two lists in a sorted way. These two list have in common the their names. I will try to give an example: the first list looks like this:
$code1 Code code1 Nation Usa $code2 Code code2 Nation Spain the second one is like this $code 1 var1 87 var2 73 $code2 var1 34 var2 23 As you can see the two list have the same names.I tried to implement the following ifelse statement but it doesn't work orde2=function(x,y){ ifelse(names(x)==names(y),list(print(xtable(x)),print(xtable(y))),NULL) What I want is the xtable of this first: $code1 Code code1 Nation Usa and after this: $code 1 var1 87 var2 73 And as the first case, the xtable of this; $code2 Code code2 Nation Spain and after this: $code2 var1 34 var2 23 Someone Knows if it possible to do this and how?? Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/xtable-with-ifelse-statement-tp2296694p2296694.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.