No, there isn't any difference other than the default type
between points
and lines
. They are just wrappers of plot.xy
, as one can easily verify from the source code:
graphics:::points.default
#function (x, y = NULL, type = "p", ...)
#plot.xy(xy.coords(x, y), type = type, ...)
#<bytecode: 0x1ecccb8>
#<environment: namespace:graphics>
graphics:::lines.default
#function (x, y = NULL, type = "l", ...)
#plot.xy(xy.coords(x, y), type = type, ...)
#<bytecode: 0x1ec7938>
#<environment: namespace:graphics>
Just an addendum: this isn't uncommon in R. For instance the read.csv
, read.table
and family are basically the same function which just differ for the default value of some arguments. These wrappers are quite handy and often add readability to your code.
Second addendum: How I found the source code of these functions? Both points
and lines
are generic functions, with methods that apply depending on the class of the object argument. You might want to read this famous question:
How can I view the source code for a function?