1

The following code I have run a number of times without any issue, but recently it is throwing an error message:

ggpairs(df_scatterplot, 
        columns = c(2:5, 14),
        lower = list(continuous = wrap("smooth", method = "lm")),
        
)

The error message says: Error in wrap("smooth", method = "lm") : unused argument (method = "lm) Previously, I used to get the output with the trendline.

I have replaced method = "lm" with other methods as well such as method = "loess" but that too came with the same error message.

Now without the last line, it works fine! Of course, I don't get the trendline!

I would like to show the trendline and hence looking for a solution to this!

Thank you wonderful people for your time and help!

Tathagato
  • 348
  • 1
  • 11
  • 2
    I'm not able to reproduce this error: `library(tidyverse); library(GGally); ggpairs(iris, lower = list(continuous = wrap("smooth", method = "lm")))` has trend lines and no warnings on my system. Please edit your question to include the output from the command `sessionInfo()` and create a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) with the libraries you are using and demonstrate the error using a publicly-available dataset (e.g. the "iris" dataset) to allow us to reproduce the issue – jared_mamrot Sep 16 '22 at 03:34
  • Thanks for checking into this! I am also not able to reproduce the error using some of my other datasets. This is perhaps unique to this small dataframe I have. – Tathagato Sep 17 '22 at 00:18
  • 1
    Here is an update on the issue! Somehow, `library(Huxtable)` was masking the `wrap` function in `library(GGally)`. I am not sure what it does but when I did not use `huxtable` I got the code to work just fine. The following was the message while I loaded back `huxtable and `GGally` stop working. `Registered S3 method overwritten by 'GGally': method from +.gg ggplot2 Attaching package: ‘GGally’ The following object is masked from ‘package:huxtable’: wrap` – Tathagato Sep 17 '22 at 07:31
  • Thanks for the update; glad you fixed your problem :) – jared_mamrot Sep 17 '22 at 08:23

0 Answers0