-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample Quiz 1 Solutions #32
Comments
Given the plot below, how would you change it to make it more effective? Also tell us why your changes would make it more effective. Solution: I would get rid of the pyramid visualization in use a bar graph instead. the X axis would be the labels (women, paid enough, paid too much) and the y axis would be the percentage. This would make the percentages easier to compare with one another and better show the actual differences between the percentages. |
Given the code below, how would you edit it to map the column vaccine to the colour and shape of the points (re-write the code with the changes you would make).
I'm using ggplot(diamonds, aes(x = carat, y = price) +
geom_point(aes(color = cut, shape = cut)) +
xlab('Carat') +
ylab('Price')
# can put all in 1 aes
ggplot(diamonds, aes(x = carat, y = price, color = cut, shape = cut)) +
geom_point() +
xlab('Carat') +
ylab('Price')
# you can also put in line breaks
ggplot(diamonds, aes(x = carat,
y = price,
color = cut,
shape = cut)) +
geom_point() +
xlab('Carat') +
ylab('Price') |
List two advantages of using a database versus a plaintext file in local storage. Solution: https://datasciencebook.ca/reading.html#reading-data-from-a-database https://datasciencebook.ca/reading.html#why-should-we-bother-with-databases-at-all Databases are beneficial in a large-scale setting:
|
Write an example of an untidy data set (it can be small and use commas to separate values into different columns, and line breaks to separate into rows)). Now write that data in a tidy format. Solution: untidy
tidy:
|
If the first 8 lines of a data file that you want to read into R looks like this:
Fill in the missing pieces to the code below so that you could successfully read it into R (assume the tidyverse library has already been loaded): traffic_data <- read_...("count.csv", ..., ...) Solution:
Note: I ended up using |
Solutions for the blank + short answer questions in the practice quiz
The text was updated successfully, but these errors were encountered: