[R] Assigning factor names to interaction plot

flokke ingaschwabe at gmail.com
Mon Oct 3 14:11:05 CEST 2011


Hi everyone,
I have the following problem: 

I have three variables, 'group', 'city' and 'pressure'

There is an interaction effect between group and city and I'd like to show
this in an interaction plot:

interaction.plot(group, city, pressure, type="b", 
                 col= c(1:2), 
                 leg.bty="o", leg.bg="blue", lwd=1, pch=c(18,24,22), 
                 xlab="Group", 
                 ylab="Pressure", 
                 main="Interaction Plot")

My problem is that I cant find a proper argument to pass factor names to the
variables 'group' and 'city'.

In the interaction plot now the groups are referred to as '1', '2' and '3'
and the citys are referred to '1', 2'. Hoewever, Id like to pass 
string character names to those ('Therapy 1, 'therapy 2 and therapy 3). I'd
also like to pass 
string character names to the varibale 'city' ('Amsterdam', "Rotterdam',
etc.)

I'm a quite new user (since two weeks), and normally I can easily find the
solution to my problems on 
the internet, but however this time I'm frustrated because I cant find
solutions that are helping me. 

I'd be very glad if you could give me a hint or could show me how to deal
with this problem.

Cheers,
Maria

--
View this message in context: http://r.789695.n4.nabble.com/Assigning-factor-names-to-interaction-plot-tp3867311p3867311.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list