我在R中绘制数据。我正在运行以下两个命令:
plot(x = df$Latitude, df$Longitude, col = heat.colors(nrow(df)), type = "p")
plot(x = df$Latitude, df$Longitude, col = df$feature, type = "p")
第一行沿着颜色渐变绘制点(具有较高值的点为红色,具有较低值的点为黄色),第二行绘制具有由features
给出的int值指示的颜色的数据。
但是,我希望将两者结合使用,以便使用feature
中的数值在刻度上绘制颜色点。在某种意义上,我想将两个参数传递给col
。我怎么能这样做?