I'm creating a function in R for plotting and calculate an ANOVA model (because I have to repeat this operation a lot of time). I wrote this function:

response_vars = c(
var_plots <- function(df, var) {
  print(table(df[, var]))
  barplot(table(df[, var]))
  for (resp_var in response_vars) {
    boxplot(df[, resp_var]~df[, var], xlab = var, ylab = resp_var)
    summary_aov <- summary(aov(df[, resp_var]~df[, var]))

But when I execute the code the summary table is like this:

enter image description here

Can I change the label of df[, var] rows?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.