Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ms_scatterchart

scatterchart object


Description

Creation of a scatterchart object that can be inserted in a 'Microsoft' document.

Usage

ms_scatterchart(data, x, y, group = NULL, labels = NULL)

Arguments

data

a data.frame

x

x colname

y

y colname

group

grouping colname used to split data into series. Optional.

labels

colnames of columns to be used as labels into series. Optional. If more than a name, only the first one will be used as label, but all labels (transposed if a group is used) will be available in the Excel file associated with the chart.

Illustrations

See Also

Other 'Office' chart objects: ms_areachart(), ms_barchart(), ms_linechart()

Examples

library(officer)
# example chart_01 -------
chart_01 <- ms_scatterchart(data = mtcars, x = "disp",
                         y = "drat")
chart_01 <- chart_settings(chart_01, scatterstyle = "marker")


# example chart_02 -------
chart_02 <- ms_scatterchart(data = iris, x = "Sepal.Length", y = "Petal.Length", group = "Species")
chart_02 <- chart_settings(chart_02, scatterstyle = "marker")

mschart

Chart Generation for 'Microsoft Word' and 'Microsoft PowerPoint' Documents

v0.3.0
MIT + file LICENSE
Authors
David Gohel [aut, cre], ArData [cph], YouGov [fnd], Rokas Klydzia [ctb] (custom labels), David Camposeco [ctb] (chart_data_smooth function), Dan Joplin [ctb] (fix scatter plot data structure)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.