用R fmsb软件包制成的雷达图上的Log10轴

时间:2018-08-02 12:25:44

标签: r radar-chart

我找不到对fmsb包制作的雷达图的轴进行对数变换的方法。可以使用内置的R函数吗?

使用提供的示例代码here(Rdocumentation here):

library(fmsb)

# Create data
data=as.data.frame(matrix( c(0.5,2,1235,11999,1234,13,456,89,6,6777) , ncol=10))
colnames(data)=c("item_1" , "item_2" , "item_3" , "item_4" , "item_5", "item_6" , "item_7" , "item_8", "item_9", "item_10" )

# Min / Max for axis
data=rbind(rep(max(data),10) , rep(0,10) , data)

# Plot the radarchart
radarchart( data  , axistype=1 ,

    #custom polygon
    pcol=rgb(0.2,0.5,0.5,0.9),
    pfcol=rgb(0.2,0.5,0.5,0.5),
    plwd=4,

    #custom the grid
    cglcol="grey",
    cglty=1,
    axislabcol="grey",
    caxislabels=ceiling(seq(min(data),max(data),length.out=4)),
    cglwd=0.8,

    #custom labels
    vlcex=0.8
    )

0 个答案:

没有答案