Error: Columns `x`, `y` must be 1d atomic vectors or lists

It's hard to tell without code formatting or the source data, but the way that bracket-notation works in R, Spectral[1] and Spectral[3] are actually data frames, as opposed to 1d atomic vectors or lists (see the vectors section of R for Data Science, for example).

Here's the difference between iris[1] and iris[,1]:

library(tidyverse)
head(iris[1])
#>   Sepal.Length
#> 1          5.1
#> 2          4.9
#> 3          4.7
#> 4          4.6
#> 5          5.0
#> 6          5.4
head(iris[,1])
#> [1] 5.1 4.9 4.7 4.6 5.0 5.4
class(iris[1])
#> [1] "data.frame"
class(iris[,1])
#> [1] "numeric"

Created on 2018-10-01 by the reprex package (v0.2.1.9000)

Could you please turn this into a self-contained reprex (short for reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.

install.packages("reprex")

If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page. The reprex dos and don'ts are also useful.

What to do if you run into clipboard problems

If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.

reprex::reprex(input = "fruits_stringdist.R", outfile = "fruits_stringdist.md")

For pointers specific to the community site, check out the reprex FAQ.