I'm plotting data in R. I'm running the following two commands:
plot(x = df$Latitude, df$Longitude, col = heat.colors(nrow(df)), type = "p")
plot(x = df$Latitude, df$Longitude, col = df$feature, type = "p")
The first line plots the points along a color gradient (points with higher values are red, points with lower values are yellow) and the second line plots data with color dictated by the int values given by features
.
However, I want to combine both such that I'm plotting points with colors on a scale using the numeric values from feature
. In some sense, I want to pass two arguments to col
. How can I do this?