문제

I'm using the rgrs package to creat a qualitative based map. I'm not a fan of the palettes provided by ColorBrewer, how can I define my own colour palette?

I tried the following...

pal<-c("#2ca25f","#99d8c9","#99d8c9")

carte.qual(Frdep, Corr, "Niveau_correlation", sp.key = "CODE_DEPT", 
       data.key = "Dep", 
       palette.qual="pal", border="grey25", 
       leg.options=list(rect.width=0.025, rect.height=0.045, 
                        inset=c(0.68, 0.345), cex=0.85))

Which returns the following error message:

Error in brewer.pal(qual.nb, palette.qual) : 
pal is not a valid palette name for brewer.pal

Removing the speech marks from "pal" returns the same message. Can anyone help?

도움이 되었습니까?

해결책

It looks like you're using the palette.qual when you should be using the palette argument. Your code should read:

pal<-c("#2ca25f","#99d8c9","#99d8c9")

carte.qual(Frdep, Corr, "Niveau_correlation", sp.key = "CODE_DEPT", 
       data.key = "Dep", 
       palette=pal, border="grey25", 
       leg.options=list(rect.width=0.025, rect.height=0.045, 
                        inset=c(0.68, 0.345), cex=0.85))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top