Page 1 of 1

p = ggplot() + geom_line (data = Auckland, aes (x = Date, y value, colour = "Auckland"),size=1) + geom_line (data = Well

Posted: Sun May 15, 2022 1:03 pm
by answerhappygod
P Ggplot Geom Line Data Auckland Aes X Date Y Value Colour Auckland Size 1 Geom Line Data Well 1
P Ggplot Geom Line Data Auckland Aes X Date Y Value Colour Auckland Size 1 Geom Line Data Well 1 (50.4 KiB) Viewed 57 times
Question 1:
A. Adjust the r code above to change the title of the legend
from "colour" to "region"
B. Adjust the r code above so that the legend lists the Regions
in this order: Auckland, Wellington, Ccanterbury, Otago.
p = ggplot() + geom_line (data = Auckland, aes (x = Date, y value, colour = "Auckland"),size=1) + geom_line (data = Wellington, aes (x = Date, y = value, colour = "Wellington"), size =1) + geom_line (data = Canterbury, aes (x Date, y = value, colour = "Canterbury"), size =1) + geom_line (data = otago, aes (x = Date, y = value, colour = "otago"),size =1) + xlab ("Period") + ylab ("rent per week (NZD)")+ 1abs (title="weekly rent in nz regions over time") print (p) Weekly rent in NZ regions over time 600- 500 - rent per week (NZD) ht colour Auckland Canterbury Otago Wellington 400- tayong 300- رام whitmanshushed 2016 2018 2020 2022 Period