This is a different problem than the one in your original post, and it's not one I'm able to reproduce:
#> Loading required package: lattice
#> Loading required package: ggplot2
trainIndex <- createDataPartition(iris$Species, p = .8,
list = FALSE,
times = 1)
#> [1,] 1
#> [2,] 2
#> [3,] 3
#> [4,] 5
#> [5,] 6
#> [6,] 7
Created on 2019-08-28 by the reprex package (v0.3.0)
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.
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.
There's also a nice FAQ on how to do a minimal reprex for beginners, below:
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.