Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CIS XXXXXXXXXXData Visualization Summer 2020 Homework # 1 Due: June 22nd mid night (11:59 PM) This homework is worth 10 points or 10% of the course grade. There are 10 questions and each question...

1 answer below »
CIS XXXXXXXXXXData Visualization
Summer 2020
Homework # 1
Due: June 22nd mid night (11:59 PM)
This homework is worth 10 points or 10% of the course grade. There are 10 questions and
each question worth 1 point.
Note: Submit the R code along with screenshot of your plot by copying and pasting them
within a word document as an answer to every question below. You may either submit that
word document or alternatively may convert it to PDF and submit it. Partial credits will be
assigned to code submitted with e
ors showing your efforts. Feel free to use question mark
(?) followed by name of the R object to know more about that R object. For instance, to know
more about the mpg data set type ?mpg.
1. Create the following scatter plot using the mpg data available within R environment. You
are required to use the ggplot function of the ggplot2 package.


2. Make all of the points in the above plot blue by using the color attribute of geom_point()
function. Your output will be as shown below.


3. Which variables in mpg data frame are categorical? Which variables are continuous?
(Hint: type ?mpg to read the documentation for the dataset)
4. What is the output of this command: ggplot(mpg, aes(x = displ, y = hwy))? Why is the
esulting graph empty? How can you fix it?
5. Differentiate between geom_col() and geom_bar() with the help of R code example(s).
You may use any data available within R environment.
6. What are the size and alpha attribute of geom_point()? Show their usage with example
R code and output. You may use any data from chapter 2 of the text with ggplot and
geom_point() functions. (Hint: type ?geom_point to read about the various attributes
of geom_point).
7. Install the “mosaicData” package within your RStudio environment. Call this package
within your cu
ent R session. Submit the R code to ca
y out these two tasks with a
screenshot demonstrating successful execution.
8. The “mosaicData” package contains the Ma
iage data. Use geom_bar() to plot the count
for race variable for this data. Your output must be as shown below:


9. Plot a histogram using geom_histogram() for the age variable of the Ma
iage dataset.
Keep the binwidth to default of 30. Your output must be as shown below:

10. Install and load “carData” package within your cu
ent R session. This package contains
the Salaries data set. Create a boxplot using geom_boxplot() for the salary distribution by
ank (Hint: use categorical variable rank on the x-axis and quantitative variable salary on
y-axis). Your resultant boxplot must be as shown below:

storytelling with data: a data visualization guide for business professionals
storytelling with data
storytelling
with data
a data visualization guide
for business professionals
cole nussbaumer knaflic
Cover image: Cole Nussbaumer Knaflic
Cover design: Wiley
Copyright © 2015 by Cole Nussbaumer Knaflic. All rights reserved.
Published by John Wiley & Sons, Inc., Hoboken, New Jersey.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, electronic, mechanical, photocopying,
ecording, scanning, or otherwise, except as permitted under Section 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of
the Publisher, or authorization through payment of the appropriate per-copy fee to
the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978)
XXXXXXXXXX, fax XXXXXXXXXX, or on the Web at www.copyright.com. Requests to the
Publisher for permission should be addressed to the Permissions Department, John
Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, XXXXXXXXXX, fax XXXXXXXXXX-
6008, or online at www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Wa
anty: While the publisher and author have used
their best efforts in preparing this book, they make no representations or wa
anties
with respect to the accuracy or completeness of the contents of this book and
specifically disclaim any implied wa
anties of merchantability or fitness for a particular
purpose. No wa
anty may be created or extended by sales representatives or written
sales materials. The advice and strategies contained herein may not be suitable for
your situation. You should consult with a professional where appropriate. Neither
the publisher nor author shall be liable for any loss of profit or any other commercial
damages, including but not limited to special, incidental, consequential, or other
damages.
For general information on our other products and services or for technical support,
please contact our Customer Care Department within the United States at XXXXXXXXXX-
2974, outside the United States at XXXXXXXXXXor fax XXXXXXXXXX.
Wiley publishes in a variety of print and electronic formats and by print-on-demand.
Some material included with standard print versions of this book may not be included
in e-books or in print-on-demand. If this book refers to media such as a CD or DVD
that is not included in the version you purchased, you may download this material
at http:
ooksupport.wiley.com. For more information about Wiley products, visit
www.wiley.com.
Li
ary of Congress Cataloging-in-Publication Data:
ISBN XXXXXXXXXXPape
ack)
ISBN XXXXXXXXXXePDF)
ISBN XXXXXXXXXXePub)
Printed in the United States of America
XXXXXXXXXX
http:
www.copyright.com
http:
www.wiley.com/go/permissions
http:
ooksupport.wiley.com
http:
www.wiley.com
To Randolph
vii
contents
foreword ix
acknowledgments xi
about the author xiii
introduction 1
chapter 1 the importance of context 19
chapter 2 choosing an effective visual 35
chapter 3 clutter is your enemy! 71
chapter 4 focus your audience’s attention 99
chapter 5 think like a designer 127
chapter 6 dissecting model visuals 151
chapter 7 lessons in storytelling 165
chapter 8 pulling it all together 187
chapter 9 case studies 207
chapter 10 final thoughts 241
ibliography 257
index 261
ix
foreword
“Power Co
upts. PowerPoint Co
upts Absolutely.”
—Edward Tufte, Yale Professor Emeritus1
We’ve all been victims of bad slideware. Hit‐and‐run presentations
that leave us staggering from a maelstrom of fonts, colors, bullets,
and highlights. Infographics that fail to be informative and are only
graphic in the same sense that violence can be graphic. Charts and
tables in the press that mislead and confuse.
It’s too easy today to generate tables, charts, graphs. I can imagine
some old‐timer (maybe it’s me?) ha
umphing over my shoulder that
in his day they’d do illustrations by hand, which meant you had to
think before committing pen to paper.
Having all the information in the world at our fingertips doesn’t make
it easier to communicate: it makes it harder. The more information
you’re dealing with, the more difficult it is to filter down to the most
important bits.
Enter Cole Nussbaumer Knaflic.
I met Cole in late 2007. I’d been recruited by Google the year before
to create the “People Operations” team, responsible for finding, keep-
ing, and delighting the folks at Google. Shortly after joining I decided
1 Tufte, Edward R. ‘PowerPoint Is Evil.’ Wired Magazine, www.wired.com/wired
archive/11.09/ppt2.html, September 2003.
http:
www.wired.com/wired/archive/11.09/ppt2.html
http:
www.wired.com/wired/archive/11.09/ppt2.html
x foreword
we needed a People Analytics team, with a mandate to make sure
we innovated as much on the people side as we did on the product
side. Cole became an early and critical member of that team, acting
as a conduit between the Analytics team and other parts of Google.
Cole always had a knack for clarity.
She was given some of our messiest messages—such as what exactly
makes one manager great and another crummy—and distilled them into
crisp, pleasing imagery that told an i
efutable story. Her messages of
“don’t be a data fashion victim” (i.e., lose the fancy clipart, graphics and
fonts—focus on the message) and “simple beats sexy” (i.e., the point is
to clearly tell a story, not to make a pretty chart) were powerful guides.
We put Cole on the road, teaching her own data visualization course
over 50 times in the ensuing six years, before she decided to strike
out on her own on a self‐proclaimed mission to “rid the world of bad
PowerPoint slides.” And if you think that’s not a big issue, a Google
search of “powerpoint kills” returns almost half a million hits!
In Storytelling with Data, Cole has created an of‐the‐moment
complement to the work of data visualization pioneers like Edward
Tufte.  She’s worked at and with some of the most data‐driven
organizations on the planet as well as some of the most mission‐driven,
data‐free institutions. In both cases, she’s helped sharpen their
messages, and their thinking.
She’s written a fun, accessible, and eminently practical guide to
extracting the signal from the noise, and for making all of us better
at getting our voices heard.
And that’s kind of the whole point, isn’t it?
Laszlo Bock
SVP of People Operations, Google, Inc.
and author of Work Rules!
May 2015
xi
acknowledgments 
My timeline of thanks Thank you to…
2015
1980
2010−CURRENT My family, for your love and support. To my love,
my husband, Randy, for being my #1 cheerleader through it all;
I love you, darling. To my beautiful sons, Avery and Dorian, for
eprioritizing my life and
inging much joy to my world.
2010−CURRENT My clients, for taking part in my effort to rid the world of ineffective
graphs and inviting me to share my work with their teams and organizations through
workshops and other projects.
Thank you also to everyone who helped make this book possible. I value every bit of input and help along the way.
In addition to the people listed above, thanks to Bill Falloon, Meg Freeborn, Vincent Nordhaus, Robin Factor,
Mark Bergeron, Mike Henton, Chris Wallace, Nick Wehrkamp, Mike Freeland, Melissa Connors, Heather Dunphy,
Sharon Polese, Andrea Price, Laura Gachko, David Pugh, Marika Rohn, Robert Kosara, Andy Kriebel, John Kania,
Eleanor Bell, Alberto Cairo, Nancy Duarte, Michael Eskin, Kathrin Stengel, and Zaira Basanez.
2007−2012 The Google Years. Laszlo Bock, Prasad Setty, Brian Ong, Neal Patel,
Tina Malm, Jennifer Kurkoski, David Hoffman,
Answered Same Day Jun 16, 2021

Solution

Abr Writing answered on Jun 19 2021
152 Votes
code.R
li
ary(ggplot2)
# Question 1
ggplot(ggplot2::mpg, aes(x = displ, y = hwy)) +
geom_point()
# Question 2
ggplot(ggplot2::mpg, aes(x = displ, y = hwy)) +
geom_point(colour = "blue")
# Question 4
ggplot(mpg, aes(x = displ, y = hwy))
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point()
# Question 5
## geom ba
ggplot(mpg, aes(x = cyl)) +
geom_bar()
## geom col
ggplot(as.data.frame(table(mpg$cyl)),
aes(x=Var1, y=Freq)) +
geom_col() +
labs(
x = "cyl",
y = "count"
)
# Question 6
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point()
## Alpha
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(alpha = 0.5)
## Size
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(aes(size = cyl))
## Size and Alpha
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(aes(size = cyl),
alpha = 0.5)
# Question 7
if(!require(mosaicData)) {
install.packages("mosaicData", dependencies = T)
li
ary(mosaicData)
}
# Question 8
ggplot(Ma
iage, aes(x = race)) +
geom_bar()
#...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here