Sweave の \Sexper{} 内で条件を使用することは可能ですか? 私がやろうとしていることの例は
\Sexpr{if(coef(model1)[3]<0){-1*round(coef(model1)[3],3)}else{round(coef(model1)[3],3)}}
より精巧に、私は次のようなものが欲しい
\Sexpr{if(x<0){paste(-1*x, "lower", sep="")}else{paste(x, "higher", sep=""}}
コードの最初のビットを試すと、次のエラーが発生します。
Error in parse(text = cmd) : <text>:2:0: unexpected end of input
1:if(coef(model1)[3]<0){-1*round(coef(model1)[3],3)
何か案は?
ご協力いただきありがとうございます、
-マーク