'Error with ggscatterplot() function from ggpubr package

I try to use ggscatter() function from ggpubr package with the following code

ggscatter(mtcars, 
             x = "hp", y = "carb", 
             cor.coef = TRUE, cor.method = "spearman", 
             xlab = "x1", ylab = "x2")

but I get the following error.

Error in parse(text = text[[i]]) : :1:16: unexpected ',' 1: italic(R)~=~0,

Thanks in advance for the help.



Solution 1:[1]

Not sure about your question as your code is working fine.

Sample data:

data(mtcars)

Sample code:

library(ggpubr)

ggscatter(mtcars, 
          x = "hp", y = "carb", 
          cor.coef = TRUE, cor.method = "spearman", 
          xlab = "x1", ylab = "x2")

Plot:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rfanatic