0

I get the error for this code:

dist_matrix_euc <- dist(movies[,2:16], method = "euclidean", diag = FALSE, upper = FALSE, p = 2)

Dataset "movies" has only numeric values (except names of columns). Full version of the error: "Error in 0 + x : non-numeric argument to binary operator". Also i attach the screen of my dataset.movies dataset segment

  • 1
    Maybe [this](https://stackoverflow.com/questions/29665428/non-numeric-argument-to-binary-operator-error-in-r) could be useful. – SabDeM May 05 '20 at 08:23
  • i tried this option, but didnt help – Getrix2020 May 05 '20 at 09:57
  • Welcome to SO. Please include a reproducible question as suggested here https://stackoverflow.com/help/minimal-reproducible-example include your data (as a dataframe object or use dput("yourdata"), the code you have tried and your expected output. This will make it more likely to get a good answer. – rj-nirbhay May 05 '20 at 10:31
  • @Getrix2020 This error usually caused variation in data types. You can check datatypes using str command: str(movies) or sapply(movies,class) – rj-nirbhay May 05 '20 at 10:38

0 Answers0