HI,
Try:
lab2<- function(var1,var2,data1){
a<- anova(lm(var2~var1,data=data1))
cat("df(between) is",a[1,1],"\n")
cat("df(within) is", a[2,1],"\n")
cat("ss(between) is", a[1,2],"\n")
cat("ss(within) is", a[2,2],"\n")
}
#or
lab3<- function(var1,var2,data1){
a<- anova(lm(var2~var1,data=data
The only permutation you likely didn't try:
>> cat("df(between) is", a[1,1], "\ndf(within) is", a[2,1])
\n has to be inside the quotes. HTH. Bryan
On May 22, 2013, at 4:34 PM, jordanbrace wrote:
> Hi everyone,
>
> I'm having some difficulty getting the linebreaks I want with the cat()
> fun
Hi everyone,
I'm having some difficulty getting the linebreaks I want with the cat()
function.
I currently have the following function:
lab1<-function(iv,dv){
a<-anova(lm(dv~iv))
cat("df(between) is",a[1,1])
cat("df(within) is", a[2,1])
cat("ss(between) is", a[1,2])
cat("ss(within) is"
3 matches
Mail list logo