line_plot | R Documentation |
Draw connected lines for variables in a data frame. The plot thereby mimics the look of SPSS graphs.
line_plot( data, variables, index = NULL, version = r2spss_options$get("version"), ... )
data |
a data frame containing the variables to be plotted. |
variables |
a character vector specifying at least one variable to be plotted on the y-axis. In case of multiple variables, separate lines are drawn for each variable and a legend is shown. |
index |
a character string specifying a variable to be plotted on the
x-axis, or |
version |
a character string specifying whether the plot should mimic
the look of recent SPSS versions ( |
... |
additional arguments to be passed down to
|
An object of class "ggplot"
, which produces
a line plot when printed.
Andreas Alfons
# load data data("Eredivisie") # log-transform market values Eredivisie$logMarketValue <- log(Eredivisie$MarketValue) # aggregate log market values by position means <- aggregate(Eredivisie[, "logMarketValue", drop = FALSE], Eredivisie[, "Position", drop = FALSE], FUN = mean) # create profile plot line_plot(means, "logMarketValue", "Position") # easier and fancier as the plot method of ANOVA results oneway <- ANOVA(Eredivisie, "logMarketValue", group = "Position") plot(oneway)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.