Please see homework 1 attachment
CIS 3306 - Data 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 errors 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 resulting 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 current R session. Submit the R code to carry out these two tasks with a screenshot demonstrating successful execution. 8. The “mosaicData” package contains the Marriage 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 Marriage dataset. Keep the binwidth to default of 30. Your output must be as shown below: 10. Install and load “carData” package within your current R session. This package contains the Salaries data set. Create a boxplot using geom_boxplot() for the salary distribution by rank (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, recording, 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) 750-8400, fax (978) 646-8600, 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, (201) 748-6011, fax (201) 748- 6008, or online at www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty 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 (800) 762- 2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. 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://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Cataloging-in-Publication Data: ISBN 9781119002253 (Paperback) ISBN 9781119002260 (ePDF) ISBN 9781119002062 (ePub) Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 http://www.copyright.com http://www.wiley.com/go/permissions http://booksupport.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 bibliography 257 index 261 ix foreword “Power Corrupts. PowerPoint Corrupts 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?) harrumphing 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 irrefutable 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 reprioritizing my life and bringing 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,