Hi,
Welcome to the RStudio community!
I like to add to @FJCC reply that indeed the plot() function does not work with the pipe operator %>% as this is part of the Tidyverse and is built to be used with compatible tidyverse functions. You can use ggplot with this pipe operator if you like to plot that way.
library(dplyr)
library(ggplot2)
data(iris)
#Use the base-R plot function
plot(iris$Sepal.Length, iris$Sepal.Width)
#Use the Tidyverse piping method with ggplot
iris %>% ggplot(aes(Sepal.Length, Sepal.Width)) + geom_point()
For more info on using Tidyverse go to their website:
Hope this helps,
PJ