2RtopicsdocumentedRtopicsdocumentedblue2green3blue2red3blue2yellow3blues ID: 841871
Download Pdf The PPT/PDF document "PackagecolourvaluesDecember82020TypePack..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1 Package`colourvalues'December8,2020TypeP
Package`colourvalues'December8,2020TypePackageTitleAssignsColourstoValuesVersion0.3.7Date2020-12-02DescriptionMapsoneoftheviridiscolourpalettes,orauser-speciedpalettetovalues.ViridiscolourmapsarecreatedbyStéfanvanderWaltandNathanielSmith,andweresetasthedefaultpaletteforthePythonMatplotliblibrary.orhttp;s://;matp;lotl;ib40;g/.OtherpalettesavailableinthislibraryhavebeenderivedfromRColorBrewerg/package=RColorBrehttp;s://;RAN;.R-p;roje;t.o;r180;werandcolorspacehttp;s://;RAN;.R-p;roje;t.o;r180;g/package=colorsp
2 acepackages.LicenseGPL-3URLhttps://symbo
acepackages.LicenseGPL-3URLhttps://symbolixau.github.io/colourvalues/BugReportshttps://github.com/SymbolixAU/colourvalues/issuesEncodingUTF-8LazyDatatrueDependsRhttp;s://;RAN;.R-p;roje;t.o;r180;(=3.3.0)SystemRequirementsC++11LinkingToBHhttp;s://;RAN;.R-p;roje;t.o;r180;(=1.72.0-3),RcppImportsgraphics,RcppRoxygenNote7.1.1Suggestscovr,microbenchmark,scales,testthat,viridisLiteNeedsCompilationyesAuthorDavidCooley[aut,cre]MaintainerDavidCooleyÜoo;ley@;symb;olix;.com;.au0;RepositoryCRANDate/Publication2020-12-0723:50:02UTC1 2Rtopicsdocumented:Rtopicsdo
3 cumented:blue2green.....................
cumented:blue2green..........................................3blue2red...........................................3blue2yellow.........................................3blues.............................................4brbg.............................................4bugn.............................................4bupu.............................................4cividis............................................5cm..............................................5colour_palettes.......................................5colour_values........................................6colour_values_rgb......................
4 ................9convert_colour.........
................9convert_colour.......................................12cyan2yellow.........................................13diverge_hcl.........................................13diverge_hsv.........................................13get_palette..........................................14gnbu.............................................14green2red..........................................15greens............................................15greys.............................................15heat.............................................15heat_hcl...........................................16inferno.........
5 ...................................16mag
...................................16magenta2green.......................................16magma............................................16matlab_like.........................................17matlab_like2........................................17oranges...........................................17orrd.............................................17piyg.............................................18plasma............................................18prgn.............................................18pubu.............................................18pubugn...........................................19puor....
6 ........................................
.........................................19purd.............................................19purples............................................19rainbow...........................................20rainbow_hcl.........................................20rdbu.............................................20rdgy.............................................20rdpu.............................................21rdylbu............................................21rdylgn............................................21reds.............................................21 blue2green3sequential_hcl..............................
7 ..........22show_colours................
..........22show_colours........................................22spectral...........................................22terrain............................................23terrain_hcl..........................................23topo.............................................23viridis............................................23ygobb............................................24ylgn.............................................24ylgnbu............................................24ylorbr............................................24ylorrd............................................25Index26 blue2greenBlue2green
8 DescriptionDataFrameoftheblue2greenpale
DescriptionDataFrameoftheblue2greenpaletteUsageblue2green() blue2redBlue2red DescriptionDataFrameoftheblue2redpaletteUsageblue2red() blue2yellowBlue2yellow DescriptionDataFrameoftheblue2yellowpaletteUsageblue2yellow() 4bupu bluesBlues DescriptionDataFrameofthebluespaletteUsageblues() brbgBrbg DescriptionDataFrameofthebrbgpaletteUsagebrbg() bugnBugn DescriptionDataFrameofthebugnpaletteUsagebugn() bupuBupu DescriptionDataFrameofthebupupaletteUsagebupu() cividis5 cividisCividis DescriptionDataframeofthecividispaletteUsagecividis() cmCm DescriptionDataFrameofthecmpaletteUsagecm() colour_palettesColourPalettes Des
9 criptionListtheavailablecolourpalettes.U
criptionListtheavailablecolourpalettes.Usagecolour_palettes(colours=NULL)color_palettes(colours=NULL)Argumentscoloursvectorofsourcecolourpalettestoreturn,oneormanyof"viridis","rcolorbrewer","grdevices","colorspace","colorramp".NULLwillreutrnallpalettes. 6colour_valuesDetailsThepalettesavaialbleincolourvalueshavebeenderivedfromthoseavaialbleinthelibrariesviridisRColorBrewergrDevicescolorspacescolorRampExamplescolour_palettes()colour_palettes("viridis")colour_palettes(colours=c("rcolorbrewer","grdevices")) colour_valuesColourValues DescriptionmapscolourstovaluesUsagecolour_values(x,
10 palette="viridis",alpha=255,na_colour="#
palette="viridis",alpha=255,na_colour="#808080FF",include_alpha=TRUE,...)color_values(x,palette="viridis",alpha=255,na_colour="#808080FF",include_alpha=TRUE,...)##S3methodforclass'character'colour_values_to_hex(x, colour_values7palette,alpha,na_colour,include_alpha,summary=FALSE)##S3methodforclass'logical'colour_values_to_hex(x,palette,alpha,na_colour,include_alpha,summary=FALSE)##S3methodforclass'factor'colour_values_to_hex(x,palette,alpha,na_colour,include_alpha,summary=FALSE)##S3methodforclass'Date'colour_values_to_hex(x,palette,alpha,na_colour,include_alpha,n_summaries=0,format=TRUE)##S3methodforclass'POSI
11 Xct'colour_values_to_hex(x,palette,alpha
Xct'colour_values_to_hex(x,palette,alpha,na_colour,include_alpha,n_summaries=0,format=TRUE) 8colour_values##S3methodforclass'POSIXlt'colour_values_to_hex(x,palette,na_colour,alpha,include_alpha,n_summaries=0,format=TRUE)Argumentsxvectorofvaluestomaptoacolourpalettecolourpalette.Seedetailsandexamplesalphaoptional.Singlevaluein[0,255]appliedtoallcolours,oradecimalin[0,1)(toindicateapercentage,noting1isexcluded),oravectorofnumericvaluesthesamelengthasx.Thenumericvectorwillbescaledintotherange[0,255].Ifamatrixpaletteissuppliedthisargumentisignored.na_colourhexstringcolourtouseforNAvaluesintheform#RRGGBBAA.include_
12 alphalogicalindicatingifthereturnedhexor
alphalogicalindicatingifthereturnedhexormatrixshouldincludethealphavalues.DefaultstoTRUE....otherargumentspossedtomethodssummarylogicalindicatingifasummaryofthecoloursshouldbereturnedaswellasthefullcolourmapping.Thiswillbetheuniqueelementsofxmappedtothecolour.n_summariespositiveinteger.Ifsuppliedasummarycolourpalettewillbereturnedinalist,containingn_summariesequallyspacedvaluesofxintherange[min(x),max(x)],andtheirassociatedcolours.Ifanon-numericxisusedthisvalueisignoredformatlogicalindicatingifthesummaryvaluesshouldbeformatted.SeedetailsDetailsThepalettecaneitherbeString-usecolour_palettes()toviewavailab
13 lepalettesMatrix-Atleast5rows,and3
lepalettesMatrix-Atleast5rows,and3(or4)columnsrepresentingthered,greenandblue(andalpha)valuesThematrixpaletterequires5rowsbecausethecoloursareinterpolatedusingacubicb-spline.Thismethodrequires5values.SeeAlsocolour_values_rgb colour_values_rgb9Examples##in-builtpalettescolour_values(x=1:5)##defaultis"viridis"colour_values(x=1:5,palette="inferno")colour_values(x=1:5,palette="plasma")colour_values(x=1:5,palette="magma")colour_values(x=1:5,palette="cividis")colour_values(x=1:5,palette="rainbow")##matrixpaletten100mgrDevices::colorRamp(c("red","green"))((1:n)/n)dfdata.frame(a=10,x=1:n)df$colcolour_values(df$x
14 ,palette=m)barplot(height=df$a,col=df$co
,palette=m)barplot(height=df$a,col=df$col,border=NA,space=0)##withanalphacolumnonthepaletten100mgrDevices::colorRamp(c("red","green"))((1:n)/n)mcbind(m,seq(0,255,length.out=100))dfdata.frame(a=10,x=1:n)df$colcolour_values(df$x,palette=m)barplot(height=df$a,col=df$col,border=NA,space=0)##singlealphavalueforallcoloursdfdata.frame(a=10,x=1:255)df$colcolour_values(df$x,alpha=50)barplot(height=df$a,col=df$col,border=NA,space=0)##vectorofalphavaluesdfdata.frame(a=10,x=1:300,y=rep(c(1:50,50:1),3))df$colcolour_values(df$x,alpha=df$y)barplot(height=df$a,col=df$col,border=NA,space=0)##returningasummarypalettecolour_valu
15 es(-10:10,n_summaries=5) colour_values_r
es(-10:10,n_summaries=5) colour_values_rgbColourValuesRGB DescriptionMapscolourstovariables,returningamatrixofRGB(A)valuesUsagecolour_values_rgb(x, 10colour_values_rgbpalette="viridis",alpha=255,na_colour="#808080FF",include_alpha=TRUE,...)color_values_rgb(x,palette="viridis",alpha=255,na_colour="#808080FF",include_alpha=TRUE,...)##S3methodforclass'character'colour_values_to_rgb(x,palette,alpha,na_colour,include_alpha,summary=FALSE)##S3methodforclass'logical'colour_values_to_rgb(x,palette,alpha,na_colour,include_alpha,summary=FALSE)##S3methodforclass'factor'colour_values_to_rgb(x,palette,alpha,na_colour,includ
16 e_alpha,summary=FALSE)##S3methodforclass
e_alpha,summary=FALSE)##S3methodforclass'Date'colour_values_to_rgb( colour_values_rgb11x,palette,alpha,na_colour,include_alpha,n_summaries=0,format=TRUE)##S3methodforclass'POSIXct'colour_values_to_rgb(x,palette,alpha,na_colour,include_alpha,n_summaries=0,format=TRUE)##S3methodforclass'POSIXlt'colour_values_to_rgb(x,palette,na_colour,alpha,include_alpha,n_summaries=0,format=TRUE)Argumentsxvectorofvaluestomaptoacolourpalettecolourpalette.Seedetailsandexamplesalphaoptional.Singlevaluein[0,255]appliedtoallcolours,oradecimalin[0,1)(toindicateapercentage,noting1isexcluded),oravectorofnumericvaluesthesamelengthasx.Th
17 enumericvectorwillbescaledintotherange[0
enumericvectorwillbescaledintotherange[0,255].Ifamatrixpaletteissuppliedthisargumentisignored.na_colourhexstringcolourtouseforNAvaluesintheform#RRGGBBAA.include_alphalogicalindicatingifthereturnedhexormatrixshouldincludethealphavalues.DefaultstoTRUE....otherargumentspossedtomethodssummarylogicalindicatingifasummaryofthecoloursshouldbereturnedaswellasthefullcolourmapping.Thiswillbetheuniqueelementsofxmappedtothecolour.n_summariespositiveinteger.Ifsuppliedasummarycolourpalettewillbereturnedinalist,containingn_summariesequallyspacedvaluesofxintherange[min(x),max(x)], 12convert_colourandtheirassociatedcolours.Ifan
18 on-numericxisusedthisvalueisignoredforma
on-numericxisusedthisvalueisignoredformatlogicalindicatingifthesummaryvaluesshouldbeformatted.SeedetailsDetailsThepalettecaneitherbeString-usecolour_palettes()toviewavailablepalettesMatrix-Atleast5rows,and3(or4)columnsrepresentingthered,greenandblue(andalpha)valuesThematrixpaletterequires5rowsbecausethecoloursareinterpolatedusingacubicb-spline.Thismethodrequires5values.SeeAlsocolour_valuesExamplescolour_values_rgb(1:5)colour_values_rgb(1:5,include_alpha=FALSE)colour_values_rgb(-25:25,n_summaries=5) convert_colourConvertColour DescriptionConvertscoloursbetweenRRGGBBAAandhexstrings,inbothdirections.U
19 sageconvert_colour(x)convert_colours(x)c
sageconvert_colour(x)convert_colours(x)convert_color(x)convert_colors(x)Argumentsxcharactervectorofhexstrings,ornumericmatrixofRRGGBBAAvalues cyan2yellow13DetailsIfacombinationofhexstringswithandwithoutalphavaluesaresupplied,thosewithoutareas-sumedtohaveanalphavalueofFFandwillbereturnedintheRRGGBBAAmatrixExamplesconvert_colour(c("#FFAA00"))convert_colour(c("#FFAA00","#FF00AAFF"))convert_colour(matrix(c(255,170,0),ncol=3))convert_colour(matrix(c(255,170,0,255),ncol=4)) cyan2yellowCyan2yellow DescriptionDataFrameofthecyan2yellowpaletteUsagecyan2yellow() diverge_hclDiverge_hcl DescriptionDataFrameofthediverge_hcl
20 paletteUsagediverge_hcl() diverge_hsvDiv
paletteUsagediverge_hcl() diverge_hsvDiverge_hsv DescriptionDataFrameofthediverge_hsvpaletteUsagediverge_hsv() 14gnbu get_paletteGetPalette DescriptionretrievesoneoftheavailablepalettesUsageget_palette(palette,rgb=TRUE)Argumentspaletteoneoftheavailablepaletes.Seecolour_palettesrgblogicalindicatingifthepaletteshouldbereturnedasanRGBmatrixTRUE,oravectorofhexstringsFALSEValue3columnmatrixifrgb=TRUE,otherwisea256-lengthvector.Examplesget_palette("viridis")get_palette("rainbow") gnbuGnbu DescriptionDataFrameofthegnbupaletteUsagegnbu() green2red15 green2redGreen2red DescriptionDataFrameofthegreen2redpaletteUsagegree
21 n2red() greensGreens DescriptionDataFram
n2red() greensGreens DescriptionDataFrameofthegreenspaletteUsagegreens() greysGreys DescriptionDataFrameofthegreyspaletteUsagegreys() heatHeat DescriptionDataFrameoftheheatpaletteUsageheat() 16magma heat_hclHeat_hcl DescriptionDataFrameoftheheat_hclpaletteUsageheat_hcl() infernoInferno DescriptionDataframeoftheinfernopaletteUsageinferno() magenta2greenMagenta2green DescriptionDataFrameofthemagenta2greenpaletteUsagemagenta2green() magmaMagma DescriptionDataframeofthemagmapaletteUsagemagma() matlab_like17 matlab_likeMatlab_like DescriptionDataFrameofthematlab_likepaletteUsagematlab_like() matlab_like2Matlab_like
22 2 DescriptionDataFrameofthematlab_like2p
2 DescriptionDataFrameofthematlab_like2paletteUsagematlab_like2() orangesOranges DescriptionDataFrameoftheorangespaletteUsageoranges() orrdOrrd DescriptionDataFrameoftheorrdpaletteUsageorrd() 18pubu piygPiyg DescriptionDataFrameofthepiygpaletteUsagepiyg() plasmaPlasma DescriptionDataframeoftheplasmapaletteUsageplasma() prgnPrgn DescriptionDataFrameoftheprgnpaletteUsageprgn() pubuPubu DescriptionDataFrameofthepubupaletteUsagepubu() pubugn19 pubugnPubugn DescriptionDataFrameofthepubugnpaletteUsagepubugn() puorPuor DescriptionDataFrameofthepuorpaletteUsagepuor() purdPurd DescriptionDataFrameofthepurdpaletteUsagep
23 urd() purplesPurples DescriptionDataFram
urd() purplesPurples DescriptionDataFrameofthepurplespaletteUsagepurples() 20rdgy rainbowRainbow DescriptionDataFrameoftherainbowpaletteUsagerainbow() rainbow_hclRainbow_hcl DescriptionDataFrameoftherainbow_hclpaletteUsagerainbow_hcl() rdbuRdbu DescriptionDataFrameoftherdbupaletteUsagerdbu() rdgyRdgy DescriptionDataFrameoftherdgypaletteUsagerdgy() rdpu21 rdpuRdpu DescriptionDataFrameoftherdpupaletteUsagerdpu() rdylbuRdylbu DescriptionDataFrameoftherdylbupaletteUsagerdylbu() rdylgnRdylgn DescriptionDataFrameoftherdylgnpaletteUsagerdylgn() redsReds DescriptionDataFrameoftheredspaletteUsagereds() 22spectral seque
24 ntial_hclSequential_hcl DescriptionDataF
ntial_hclSequential_hcl DescriptionDataFrameofthesequential_hclpaletteUsagesequential_hcl() show_coloursShowColours DescriptionPlotsalltheselectedcolours.Seecolour_palettesforavaialblecolours.Usageshow_colours(colours=colour_palettes())ArgumentscoloursvectorofcolourpalettesExamples##viewallthecolourpalettesshow_colours()##viewaselectionofcolourpalettesshow_colours(colours=colour_palettes(c("viridis","grdevices"))) spectralSpectral DescriptionDataFrameofthespectralpaletteUsagespectral() terrain23 terrainTerrain DescriptionDataframeoftheterrainpaletteUsageterrain() terrain_hclTerrain_hcl DescriptionDataFrameofth
25 eterrain_hclpaletteUsageterrain_hcl() to
eterrain_hclpaletteUsageterrain_hcl() topoTopo DescriptionDataFrameofthetopopaletteUsagetopo() viridisViridis DescriptionDataframeoftheviridispaletteUsageviridis() 24ylorbr ygobbYgobb DescriptionDataFrameoftheygobbpaletteUsageygobb() ylgnYlgn DescriptionDataFrameoftheylgnpaletteUsageylgn() ylgnbuYlgnbu DescriptionDataFrameoftheylgnbupaletteUsageylgnbu() ylorbrYlorbr DescriptionDataFrameoftheylorbrpaletteUsageylorbr() ylorrd25 ylorrdYlorrd DescriptionDataFrameoftheylorrdpaletteUsageylorrd() Indexblue2green,3blue2red,3blue2yellow,3blues,4brbg,4bugn,4bupu,4cividis,5cm,5color_palettes(colour_palettes),5color_value
26 s(colour_values),6color_values_rgb(colou
s(colour_values),6color_values_rgb(colour_values_rgb),9colour_palettes,5,14,22colour_values,6colour_values_rgb,9colour_values_to_hex.character(colour_values),6colour_values_to_hex.Date(colour_values),6colour_values_to_hex.factor(colour_values),6colour_values_to_hex.logical(colour_values),6colour_values_to_hex.POSIXct(colour_values),6colour_values_to_hex.POSIXlt(colour_values),6colour_values_to_rgb.character(colour_values_rgb),9colour_values_to_rgb.Date(colour_values_rgb),9colour_values_to_rgb.factor(colour_values_rgb),9colour_values_to_rgb.logical(colour_values_rgb),9colour_values_to_rgb.POSIXct(colour_values_
27 rgb),9colour_values_to_rgb.POSIXlt(colou
rgb),9colour_values_to_rgb.POSIXlt(colour_values_rgb),9convert_color(convert_colour),12convert_colors(convert_colour),12convert_colour,12convert_colours(convert_colour),12cyan2yellow,13diverge_hcl,13diverge_hsv,13get_palette,14gnbu,14green2red,15greens,15greys,15heat,15heat_hcl,16inferno,16magenta2green,16magma,16matlab_like,17matlab_like2,17oranges,17orrd,17piyg,18plasma,18prgn,18pubu,18pubugn,19puor,19purd,19purples,19rainbow,20rainbow_hcl,20rdbu,20rdgy,2026 INDEX27rdpu,21rdylbu,21rdylgn,21reds,21sequential_hcl,22show_colours,22spectral,22terrain,23terrain_hcl,23topo,23viridis,23ygobb,24ylgn,24ylgnbu,24ylorb