coord_plot: Coordinate plot

coord_plotR Documentation

Coordinate plot

Description

Calculate the means (or other function defined in 'group_func' parameter) per group to analyze how each segment behave. It scales each variable mean inti the 0 to 1 range to easily profile the groups according to its mean. It also calculate the mean regardless the grouping. This function is also useful when you want to profile cluster results in terms of its means.

Usage

coord_plot(data, group_var, group_func = mean, print_table = FALSE)

Arguments

data

input data source

group_var

variable to make the group by

group_func

the data type of this parameter is a function, not an string, this is the function to be used in the group by, the default value is: mean

print_table

False by default, if true it retrieves the mean table used to generate the plot.

Value

coordinate plot, if print_table=T it also prints a table with the average per column plus the average of the whole column

Examples


# calculating the differences based on function 'mean'
coord_plot(data=mtcars, group_var="cyl")
# printing the table used to generate the coord_plot
coord_plot(data=mtcars, group_var="cyl", print_table=TRUE)
# printing the table used to generate the coord_plot
coord_plot(data=mtcars, group_var="cyl", group_func=median, print_table=TRUE)


funModeling documentation built on May 29, 2024, 3:24 a.m.