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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 56 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply