STAT 509: Q and A
Search
everywhere
only in this topic
Advanced Search
Lab0 question 3
Classic
List
Threaded
♦
♦
Locked
5 messages
Axel
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Lab0 question 3
Is there a way to plot multiple variables into the same graph, like plotting both the present birth counts of the boys and girls into the same variable without R adding them together or reducing the amount of data into a single line?
Axel
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Lab0 question 3
This is how I was able to plot multiple lines:
plot(present$year, present$boys,type="l")
lines(present$year,present$girls,type="l")
Darth Knight
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Lab0 question 3
That looks good. This would work as well:
matplot(present$year,cbind(present$boys,present$girls),type="l")
brice
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Lab0 question 3
I did plot(present$boys/present$girls, present$year)
use the boy to girl ratio as one variable
Darth Knight
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Lab0 question 3
I think OP wanted to explore a little bit of "Graphics in R" independently.
But, brice's idea looks similar to the one required in the question.
Maybe it would be beneficial to flip the arguments.
Free forum by Nabble
Edit this page