Warning Midterm Exam (Part 2 of 2) on Jan 9, 2025, 3:30–5:30 PM. at RB3208 Total Score: 15% (5% Multiple Choice, 10% Writing R Code). Topics: - Data Structure: Data Frame - Data Wrangling - Data Structure: XTS Project 1: 10% Create your CV using Quarto and upload the HTML and related files to CMU’s personal web hosting. 1. Submit your HTML file to your CMU personal web hosting. 2. Zip your project folder. The zip file should include the .qmd file, any image files, and CSS files (if used). I will render your files to compare them with your URL. Send your URL and the zip file to my email: somsak.c@icdi.cmu.ac.th before midnight on January 5, 2025. Content Requirements: Your CV must include: - Your picture - Your birthday - Your education - Your hobbies - Links to at least 2 social media platforms - Your future plans Criteria: 1. The HTML file and .qmd file must match. 2. Use a theme. 3. Use CSS. 4. Include a table. 5. Include a tabset 6. Include a video. 5. Use icons from Font Awesome (e.g., Facebook, YouTube, LINE, WeChat, etc.). 8. Modify the layout creatively.
Additional Note: Some of your score will be determined by votes from your peers.
Multiple Choices: ggplot2(Bar Plot)
Which of the following code snippets correctly creates a bar plot for the variable Species in the iris dataset? ::: {.cell}
What argument in geom_bar() is used to create a bar plot with bars filled by a variable such as Species? ::: {.cell}
:::
If you want to display the count of each category on top of each bar in a bar plot, which function should you use? ::: {.cell}
:::
To reorder bars based on the mean value of another variable (e.g., Sepal.Width for each Species), which function can be used within aes()? ::: {.cell}
:::
Which of the following will add a color outline around each bar in the bar plot? ::: {.cell}
:::
What does the position = "dodge" argument in geom_bar() do in a grouped bar plot? ::: {.cell}
:::
Which of the following code snippets creates a horizontal bar plot for the variable Species in the iris dataset? ::: {.cell}
:::
To display bars with a frequency count instead of raw counts, you should set the y aesthetic in aes() to which of the following? ::: {.cell}
:::
Which of the following will set the bar color for each level of Species using a color palette in a ggplot2 bar plot? ::: {.cell}
:::
To add labels at the top of each bar, which combination of geom_bar() and geom_text() will work correctly? ::: {.cell}
:::
Which function is used to add a title to the bar plot? ::: {.cell}
:::
How would you customize a bar plot to have bars with transparency using the alpha parameter? ::: {.cell}
:::
What function is used to change the bar colors manually in a bar plot? ::: {.cell}
:::
Which of the following would create a stacked bar plot with bars divided by a variable Type? ::: {.cell}
:::
To create a proportional stacked bar plot, what should you set position to in geom_bar()? ::: {.cell}
:::
Which argument should be modified to adjust the width of the bars in a ggplot2 bar plot? ::: {.cell}
:::
To remove the legend from a ggplot2 bar plot, which function should be used? ::: {.cell}
:::
If you want the bars ordered by frequency, which function should you use on the variable within aes()? ::: {.cell}
:::
Which function would you use to change the axis labels of a ggplot2 bar plot? ::: {.cell}
:::
Which of the following codes would change the color palette of a bar plot for a categorical variable Species to the "viridis" palette? ::: {.cell}
:::
How can you add a customized legend title for the fill aesthetic in a ggplot2 bar plot? ::: {.cell}
:::
If you want to change the color of the text labels on the x-axis, which code should you use? ::: {.cell}
:::
How would you display the bars in decreasing order of frequency for a categorical variable, Category? ::: {.cell}
:::
Which of the following arguments would be used to remove grid lines in a bar plot? ::: {.cell}
:::
To display the count values on top of each bar with a font size of 5, which code should you use? ::: {.cell}
:::
If you want to create a bar plot with custom bar widths for each category in Category, which argument will allow you to adjust the width of all bars simultaneously? ::: {.cell}
:::
Which function would you use to add custom x-axis and y-axis limits to a ggplot2 bar plot? ::: {.cell}
:::
To rotate x-axis text labels by 45 degrees, which code should be used? ::: {.cell}
:::
Which of the following ggplot2 themes provides a minimalistic look with no background color? ::: {.cell}
:::
To change the spacing between bars in a dodged bar plot, which of the following arguments is required? ::: {.cell}