I can pipe from ggplot2 to plotly using:
library(tidyverse)
library(plotly)
diamonds %>%
{ggplot(.,aes(carat, price)) +
geom_point()} |>
ggplotly()
though I use the magrittr pipe and the base R pipe in the one chain.
Replacing the magrittr pipe with the base R pipe gives:
Error: function '{' not supported in RHS call of a pipe
Is there a way to just use the base R pipe?
I found R >4.1 syntax: Error: function 'function' not supported in RHS call of a pipe and https://github.com/plotly/plotly.R/issues/1229
Breaking the chain avoids the pipe issue:
p <- diamonds |>
ggplot(aes(carat, price)) +
geom_point()
ggplotly(p)