Please post the ggplot code you are using. Even better, include the code to make a small data frame and the ggplot call that produces the error when you try to plot that data frame.
Your code does run without error for me.
The thread you link to in Stack Overflow suggests the problem appears after installing new packages. Did you do that between the time your code worked and when it started to fail?
immediately after the error? You may have to install the rlang package. Note which packages are mentioned in the output and reinstall those. I am simply repeating what the SO thread suggests but it seems like a reasonable path.
Okay, when I run rlang::last_error() this is what I get
<error/rlib_error_dots_named>
2 components of `...` had unexpected names.
We detected these problematic arguments:
* `x`
* `y`
Did you misspecify an argument?
Backtrace:
1. ggplot2::ggplot(df, aes(x = Month, y = Frequency))
3. tidyr:::aes(x = Month, y = Frequency)
4. ellipsis::check_dots_unnamed()
5. ellipsis:::action_dots(...)
I also ran rlang::last_trace() and get this:
<error/rlib_error_dots_named>
2 components of `...` had unexpected names.
We detected these problematic arguments:
* `x`
* `y`
Did you misspecify an argument?
Backtrace:
x
1. +-ggplot2::ggplot(df, aes(x = Month, y = Frequency))
2. +-ggplot2:::ggplot.default(df, aes(x = Month, y = Frequency))
3. \-tidyr:::aes(x = Month, y = Frequency)
4. \-ellipsis::check_dots_unnamed()
5. \-ellipsis:::action_dots(...)```
I would start with using uninstall.packages() to remove ggplot2 and tidyr and then reinstall them. Do let us know if that works. I have not seen this problem before.
Still not working, i uninstalled and reinstalled ggplot2 and tidyr and was still unable to run a simple bar chart plot (per the simple dataframe of month and frequency code i have above)
(update) I have also tried uninstalling all of R and R studio and reinstalling everything completley so now all of my packages are newly installed and the most updated. but i still have the same error.... could this possibly be an error with the version 4.1.0 of R?
thats good, I think therefore the trace is misleading in at least that tidyr::: doesnt have an aes function in the name space. but sorry, it doesnt tell me how to solve your issue.
As you can see I am using R version 4.04. Have you tried downgrading?
Also, why is there an 'aes' object in the global environment? Maybe it doesn't matter, but I am just seeing one object when I run getAnywhere(aes):
> getAnywhere(aes)
A single object matching βaesβ was found
It was found in the following places
package:ggplot2
namespace:ggplot2
with value
function (x, y, ...)
{
exprs <- enquos(x = x, y = y, ..., .ignore_empty = "all")
aes <- new_aes(exprs, env = parent.frame())
rename_aes(aes)
}
<bytecode: 0x7fae89af68f8>
<environment: namespace:ggplot2>
thats a good catch. the original poster may have accidently created a competing aes() function that conflicts with that provided by ggplot2. I didnt notice it when looking at their post !
thanks so much for your reply. can you explain a little more about the "aes" object in the global environment comment? Im confused as to what you mean.... I thought aes was part of the argument for a ggplot function.