Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ETC5523: Package Assessment Instructions
This assessment requires you to make an R package. 1. Accept the assessment at GitHub Classroom: LINK. All your work should be pushed to your package assessment repository. You are encouraged to push to the repository regularly to avoid unwanted technical issues close to the deadline. By accepting this assessment, you acknowledge that what you submit to your repository is your own work. (1 mark) 2. For this assessment you will need to create an R package that defines a custom colour palette and write a few functions that enable the palettes to be used as both a discrete and continuous scale in ggplot2. The aforementioned Github repository has a skeleton of the package layout for you, including stubs of the functions that you should include. You will need to complete following tasks while developing the package: • The DESCRIPTION file includes an informative name and title for your package, as well as a valid author field and dependencies. There should also be a valid LICENCE file. (3 marks) • There is a README.md file that has clear instructions on how to install the package from GitHub, and gives a quick overview of the package goals. (3 marks) • The discrete palette you create has at least five colours. (1 mark) • There is a list defined in your package called NAME_colours (where NAME is the name of the palette you’ve come up with), that defines the hex colours used in your palette. • There is an exported function called NAME_pal() (where NAME is the name of the palette you’ve come up.) (3 marks). – This function should have an argument called direction that allows the user reverse the order of the palette. – This function should itself return a function with an argument called n where n is the number of colours being picked. (See the stub if this is confusing.). – The returned function should message or warn the user if n is larger than the number of colours in your palette. • There is an exported function called scale_colour_NAME_d() that uses ggplot2::discrete_scale to allow ggplot2 to use your colour palette. It should have an argument called direction to allow the colours to be reversed. (3 marks) • There is a corresponding scale_fill_NAME_d() exported function that allows your palette to be used for fill aesthetics in ggplot2. (2 marks) • There is an exported function called scale_colour_NAME_seq_c() that allows a user to pass a name of a colour in your palette and generate a sequential continuous colour scale (5 marks). – this function should throw an error if the name supplied by a user is not in your palette. 1 – by default this function should have the input colour as the baseline colour and then use colorspace::lighten to produce the high luminance colour for the top of the scale (i.e. lighter colours correspond to higher values). – there should be an argument to the function that allows the user to define the amount of lightening. – the function should allow the user to reverse the result so the baseline colour is at top of scale. – the function should use ggplot2::scale_colour_gradient() to generate the sequential palette. • Write unit tests for functions to verify that warnings/messages/errors appear when they should. (3 marks) • All functions in the package are documented with roxygen2 according to guidelines given in lectures. (3 marks) • There should be a vignette that describes how to use your palette functions on the palmerpenguins dataset. – the vignette is a HTML vignette – the vignette gives an overview of your palette, and the colours that are in it – the vignette shows how the palette can be used with ggplot2 by making a bar chart and a scatter plot on the palmerpenguins data. (5 marks) • Documentation and vignettes have correct spelling, grammar and punctuation. (1 mark) • The package passes R CMD CHECK without errors or warnings (3 marks) Hints and Notes • Maximum of 3 bonus marks for significant effort. • Use devtools::check() early and often.