Um, you can just call the plot function. A sample matrix:
data <- cbind(x = 1:10, y = runif(10))
class(data)
## [1] "matrix"
plot(data)
This also works for a data frame.
data <- data.frame(x = 1:10, y = runif(10))
plot(data)
In general, (where there are more than two columns), you usually want to use with
.
with(data, plot(x, y))
2
solved Plot euclidian points in R from data frame [closed]