Anonymous
Anonymous

Reputation: 532

Error in changing the main title of an R plot using psych package

In the help page of the psych package, it says that I can pass more graphic parameters to the outlier() function. My syntax is really simple and as follows:

outlier(na.omit(data[,51:56]), plot = TRUE, main = 'my title')

This returns: Error in plot.default(sx, sy, xlab = xlab, ylab = ylab, ...) : formal argument "main" matched by multiple actual arguments. I have the feeling this means that the function tries to have the default title (by the psych package) as well as the title I give (i.e. my title).

Is there a way to overwrite this or fix it? Or probably I am doing something that needs to be fixed.

Reproducible example

A <- floor(runif(30, 1,5))
B <- floor(runif(30, 1,5))
C <- floor(runif(30, 1,5))
D <- floor(runif(30, 1,5))
E <- floor(runif(30, 1,5)) 
f <- floor(runif(30, 1,5))

sample.data <- data.frame(A, B, C, D, E, f)

outlier(sample.data, plot = TRUE, main = 'my title')

Upvotes: 2

Views: 391

Answers (1)

Darren Tsai
Darren Tsai

Reputation: 35594

I clear the color of title. Hope to solve your problem.

outlier(sample.data, plot = TRUE, col.main = NA)
title("My Title")

Upvotes: 2

Related Questions