ccosine | R Documentation |
This function takes a dataframe and a factor in input, and returns a matrix with the Cosine distances about it.
ccosine(
dataset,
formula,
plot = TRUE,
plot_title = "Cosine Distance Between Groups"
)
dataset |
A dataframe. |
formula |
The factor which you want to calculate the Cosine distances matrix. |
plot |
If TRUE, shows a plot of the Cosine distances matrix. |
plot_title |
The title of the plot. |
Calculate Cosine distance
The matrix containing distances.
# Example with iris dataset
ccosine(iris, ~Species, plot = TRUE, plot_title = "Cosine Distance Between Groups")
# Example with mtcars dataset
ccosine(mtcars, ~am, plot = TRUE, plot_title = "Cosine Distance Between Groups")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.