Open j-sirgo opened 2 years ago
Thanks for writing.
Are you able to provide a reproducible example?
Using your code with a made-up data set of the same variables gives me the expected result:
set.seed(1234)
dt <- data.frame(year = rep(2015:2020, 3),
val = c(replicate(3, runif(6))),
Series = factor(paste("Series", rep(1:3, each = 6))))
library(geomtextpath)
#> Loading required package: ggplot2
ggplot(dt, aes(x = year, y = val)) +
scale_color_brewer(palette="Set1") +
geom_textline(aes(label = Series, color = Series), vjust = -0.8, size = 6,
hjust = "ymax", linewidth = 2, text_smoothing = 30)
Created on 2022-05-04 by the reprex package (v2.0.1)
Thanks for responding. I just tried your working example and I still get:
Warning message:
Ignoring unknown parameters: text_smoothing
Could it be the version of R or or another package?
I don't know of another function called geom_textline
- can you show the output of just typing geom_textline
in the console to ensure it is the correct version? Obviously a restart of Rstudio and a clean workspace are worth a try too.
Here is the output:
> geom_textline
function (mapping = NULL, data = NULL, stat = "identity",
position = "identity", na.rm = FALSE, orientation = NA,
show.legend = NA, inherit.aes = TRUE, ...)
{
layer(data = data, mapping = mapping, stat = stat, geom = GeomTextLine,
position = position, show.legend = show.legend, inherit.aes = inherit.aes,
params = list(na.rm = na.rm, orientation = orientation,
...))
}
<bytecode: 0x00000000159e17c8>
<environment: namespace:geomtextpath>
And running without other packages attached ? (except ggplot2 obviously)
No. But I dropped
library(forcats)
library(ggforce)
library(ggrepel)
library(ggh4x)
library(ggstream)
And it did not produce the error. Perhaps one of these creates some confusion.
Thanks for that. There must be a clash somewhere with one of these packages. I'll investigate and keep you posted.
Judging by the function body, this might be from an older version of geomtextpath. Do you run into the same error with the current version on github? (remotes::install_github("AllanCameron/geomtextpath", quiet = TRUE)
)
I am using the latest from GitHub geomtextpath_0.1.0.9000
In that case I don't understand why the function body you printed contains params = list(na.rm = na.rm
whereas the github version has the following:
I am using geomtextpath_0.1.0.9000 in R and I get:
Ignoring unknown parameters: text_smoothing
My code:
What seems to be the issue? My session info below: