STAD29 / STA 1007 Assignment 8
STAD29 / STA 1007 assignment 8 Due Tuesday Mar 21 at 11:59pm on Blackboard Packages (needed by me but not necessarily by you): library(MASS) library(tidyverse) ## -- Attaching packages ---------------------------------- tidyverse 1.2.1 -- ## ggplot2 2.2.1.9000 purrr 0.2.4 ## tibble 1.4.2 dplyr 0.7.4 ## tidyr 0.8.0 stringr 1.3.0 ## readr 1.1.1 forcats 0.3.0 ## -- Conflicts ------------------------------------- tidyverse conflicts() -- ## x dplyr::filter() masks stats::filter() ## x dplyr::lag() masks stats::lag() ## x dplyr::select() masks MASS::select() library(ggrepel) This assignment is worth a total of 27 marks. 1. Consider the fruits apple, orange, banana, pear, strawberry, blueberry. We are going to work with these four properties of fruits: • has a round shape • Is sweet • Is crunchy • Is a berry (a) Make a table with fruits as columns, and with rows \round shape", \sweet", \crunchy", \berry". In each cell of the table, put a 1 if the fruit has the property named in the row, and a 0 if it does not. (This is your opinion, and may not agree with mine. That doesn't matter, as long as you follow through with whatever your choices were.) Solution: Something akin to this: Fruit Apple Orange Banana Pear Strawberry Blueberry Round shape 1 1 0 0 0 1 Sweet 1 1 0 0 1 0 Crunchy 1 0 0 1 0 0 Berry 0 0 0 0 1 1 You'll have to make a choice about \crunchy". I usually eat pears before they're fully ripe, so to me, they're crunchy.
[Show full text]