Re: [R] Linebreaks in cat() functions that call other variables?

2013-05-22 Thread arun
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

Re: [R] Linebreaks in cat() functions that call other variables?

2013-05-22 Thread Bryan Hanson
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

[R] Linebreaks in cat() functions that call other variables?

2013-05-22 Thread jordanbrace
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"