Error in R: plot.new has not been called yet (2 Examples)

In this R tutorial you’ll learn how to solve the error “plot.new has not been called yet”.

Example 1: Replicating the Error Message: plot.new has not been called yet

lines(c(3, 1, 8, 8, 5))        # Adding lines to non-existent graph (Error)
# Error in plot.xy(xy.coords(x, y), type = type, ...) : 
#   plot.new has not been called yet

Example 2: Solving the Error Message: plot.new has not been called yet

plot(seq(0, 8, 2))             # Drawing graph in R
lines(c(3, 1, 8, 8, 5))        # Adding lines to graph

r graph figure 1 error r new has not been called yet

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top