At end of question is script (plus on github). The GitHub repo is here and can be installed with
install.packages("devtools")
devtools::install_github("ArtieLadie/RanglaPunjab")
MergePalette(name,name2)
takes two names. If person only passes one name, I want the following to execute and then exit the function,
Enter 2 valid palettes. Run ListPalette() for list of palettes.
Unfortunately, when I execute MergePalette("Teej")
, I get
Error in MergePalette("Teej") :
argument "name2" is missing, with no default
How to fix this
MergePalette <- function(name,name2){
pal <- RanglaPunjab(name)
if (is.null(name2)){
stop("Enter 2 valid palettes. Run ListPalette() for list of palettes.")
}
pal2 <- RanglaPunjab(name2)
new_pal <-unique(c(pal,pal2))
new_pal
}