I have the latitudes and longitudes to create a sphere in R. What I need to do is color the sphere according to corresponding amplitudes. It is 3 columns in a excel file: lat, long and amplitude. So each row is a data point. What I get out is a uniform pattern - It cannot be reading the values from the amplitude column.
test$x<-0.5*cos(test$lat)*cos(test$long)
test$y<-0.5*cos(test$lat)*sin(test$long)
test$z<-0.5*sin(test$lat)
test$color<-test$amplitude
ramp<- colorRamp(c("blue", "red"))((test$color)/max(test$color))
plot3d(x= test $x,y= test $y,z= test $z,xlim=c(-0.6,0.6), ylim=c(-0.6,0.6),zlim=c(-0.6,0.6),xlab = "X", ylab = "Y", zlab = "Z", col=test$color)
Expected result is for each x,y,z point to be colored according to the amplitude.sphere_4