I want to change the text on the diagonals produced by the following code in R (I want to change the text showing Sepal.Length, Sepal.Width, Petal.Length and Petal.Width).

![Graph produced by the code below](https://i.stack.imgur.com/bgkNR.png)

I've tried inserting something for the diag.panel argument in the "pairs" function, but have had no luck with that.

```
#Extracts the iris species column from the iris dataset
iris_class = iris$Species

#Change the class from characters to numerical values for indexing
# #1 = Iris-setosa
# #2 = Iris-versicolor
# #3 = Iris-virginica
class_to_number = as.numeric(factor(iris_class))

#A function to show the linear regression line in each graph
upper_panel_regression_line = function(x,y, ...){
  points(x,y,...)
  linear_regression = lm(y~x)
  linear_regression_line = abline(linear_regression)
}

#A function to calculate and show the R-squared value of each panel
lower_panel_r_squared = function(x, y, ...){
  usr <- par("usr"); on.exit(par(usr))
  par(usr = c(0, 2, 0, 2))
  r = cor(x, y)
  r_squared = round(r^2, digits = 2)
  text_of_r_squared = paste0("R-squared = ", r_squared)
  text(1, 1, text_of_r_squared)
}

pairs(iris[1:4], main = "Predicting Iris Class", 
lower.panel=lower_panel_r_squared, upper.panel = 
        upper_panel_regression_line, col=c("red","blue","green") [class_to_number])

```