generating radar plots using a single dataframe

It is fairly straightforward to do this, instead of passing the whole data frame to radachart() function, just pass the required data for one site.

df = data.frame(ambient_air_temp = c(85, -40, 9.176667, 8.492500,  8.477500, 8.475000),
                rel_hum = c(100.0000,0.0000,71.0700, 80.9600, 76.9875,76.5525 ),
                bar_pre = c(2000.000, 10.000, 1013.167, 1014.000, 1012.675, 1013.775),
                ave_ws = c(160,0,4.043333,2.035000,6.842500,6.335000),
                pd2.5 = c(999.9, 0, 5.133333, 5.600000, 6.275000, 5.175000),
                pd10 = c(1999.9, 0, 25.16667, 25.10000, 28.15000, 30.20000))

row.names(df) = c("1","2","arc1045","arc1047","arc1048","arc1050")

library(fmsb)
pltrd = function(idx) radarchart(df[c(1,2,idx),], title = row.names(df)[idx])

Since your data is in rows = {3,4,5,6}, you can call this function using those row values. Note that rows = {1, 2} are required to be the minimum/maximum values for each variable…

pltrd(3)

enter image description here

pltrd(4)

enter image description here

pltrd(5)

enter image description here

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top