Hello everybody!

I have again another newbie-question. I was trying to plot three curves
within one single
plot: Crime development (relative frequencies) according to the hours of tv
consume per week (high/low/all together).
Here are the data:

par(mfrow=c(1,1))
# Data input
tvHrs<-c(21,22,23,24,25,26,27,28,21,22,23,24,25,26,27,28,2,3,4,5,6,7,8,9,10,11,12,13,14)
crimeDvp<-c(2,2,2,2,2,3,3,3,3,3,3,3,4,4,5,5,2,2,3,3,3,3,3,4,4,4,4,5,5)

crimeDvp<-factor(crimeDvp, levels=1:5,
labels=c("strongly\nincreased","increased","equal","decreased","strongly\ndecreased"),
ordered=T)
data<-data.frame(tvHrs, crimeDvp)

# Plotting lines
plot(prop.table(table(crimeDvp)), type='b', ylab='percent', xlab='crime
development')
legend("topright", inset=.05, title="TV consume", c("high","low","all"),
fill=c("red","black","green"))


I have experimented with the lines()-function, but couldnt do it. Thank you
for any hints!

David

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to