NAs introduced by coercion

#1
hii, I am trying to plot a 3d-scatter graph , but it shows the error:

Warning in xyz.coords(x, y, z, xlab = xlabel, ylab = ylabel, zlab = zlabel, :
NAs introduced by coercion

I have attached my dataset and code files. In this user is selecting the dataset(moons.csv) and then by graphs , choosed the different column names for 3d-scatter.

here is the code of only 3d-scatter:
output$plot4<-renderPlot({
x1<-data()
df <- Y()
X=input$scat_o
Y=input$scat_t
Z=input$scat_th
plot3d(data=data(),X, Y , Z,col="red",size=3)
})

I have included the package rgl also.
please help me out to solve this...i would be highly grateful for any suggestions
 
#2
Hi kavita,

frankly i do not understand the code and have never worked with shiny. Therefore please bear with me i the following is to profane or you already might have checked for it.

Everytime i do get the Warning (its not an Error as far as i know) "NAs introduced by coercion" i or R tried to use a non-numeric variable like characters or factors for a numeric operation. Maybe somewhere in your code or some function you are calling are changing a variable to character or factor.

This is all i can give.

Have a nice day

Tester1234
 

JesperHP

TS Contributor
#3
Also this might very well happen when reading the dataset ... that is some variable intended to be numerical is stored as charachter for example if decimals are indicated with , rather than . or something similar