12.07.2015 Views

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14 get.distinct.colsUsageforce.scalar(x, default = 1, min = -10^10, max = 10^10)Argumentsxdefaultminmaxthe object to ensure is a scalarthe value to revert to if the format of x is illegala lower bound for the output, anything below this is set to minan upper bound for the output, anything above this is set to maxValuethe object x if already legal, first element if a vector, the min or max value if x is outside the specifiedbounds, or the value of default otherwiseSee Alsoforce.percentageExamplesforce.scalar(1.5)force.scalar(NULL,default=.5)force.scalar(NA,default=.4,min=5,max=10) # default is outside range!force.scalar(rnorm(1000))force.scalar(101,max=50)force.scalar(list(0.4,1,2,3,4,"test"))force.scalar(data.frame(test=c(1,2,3),name=c("test","me","few")))force.scalar(Inf)get.distinct.colsReturn up to 22 distinct colours.DescriptionUseful if you want to colour 22 autosomes, etc, because most R colour palettes only provide 12or fewer colours, or else provide, a gradient which is not distinguishable for discrete categories.Manually curated so the most similar colours aren’t side by side.Usageget.distinct.cols(n = 22)Argumentsnnumber of unique colours to return

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!