ms_radarchart: Radarchart object

View source: R/ms_chart.R

ms_radarchartR Documentation

Radarchart object

Description

Creation of a radar (spider) chart object that can be inserted in a 'Microsoft' document.

Usage

ms_radarchart(data, x, y, group = NULL, labels = NULL, asis = FALSE)

Arguments

data

a data.frame

x

column name for x values.

y

column name for y values.

group

grouping column name used to split data into series. Optional.

labels

column names of columns to be used as custom data labels displayed next to data points (not axis labels). Optional. If more than one name is provided, only the first one will be used as a label, but all labels (transposed if a group is used) will be available in the Excel file associated with the chart.

asis

logical parameter defaulting to FALSE. When FALSE, the data is reshaped internally so that each series becomes a separate column. When TRUE, the data is used as-is and must already have one column for categories and one column per series, and y accepts a vector of series column names. asis describes the input shape read by the constructor. Not to be confused with the write_data argument of sheet_add_drawing.ms_chart(), which controls whether mschart writes the chart's data into an Excel sheet at embed time. The two are independent.

Value

An ms_chart object.

See Also

chart_settings(), chart_ax_x(), chart_ax_y(), chart_data_labels(), chart_theme(), chart_labels()

Other 'Office' chart objects: ms_areachart(), ms_barchart(), ms_boxplotchart(), ms_bubblechart(), ms_chart_combine(), ms_funnelchart(), ms_histogramchart(), ms_linechart(), ms_paretochart(), ms_piechart(), ms_scatterchart(), ms_stockchart(), ms_sunburstchart(), ms_treemapchart(), ms_waterfallchart()

Examples

library(officer)

dat <- data.frame(
  axis = c("Sales", "Marketing", "Dev", "Support", "HR"),
  s1 = c(4, 3, 5, 2, 4),
  s2 = c(3, 5, 2, 4, 3)
)
dat_long <- data.frame(
  axis = rep(dat$axis, 2),
  value = c(dat$s1, dat$s2),
  group = rep(c("Team A", "Team B"), each = 5)
)

radar <- ms_radarchart(
  data = dat_long, x = "axis",
  y = "value", group = "group"
)
radar

mschart documentation built on May 17, 2026, 1:09 a.m.