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]:
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.
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.
I actually don't recommend using that notation for ggplot2, I was just trying to illustrate why you can't use the single bracket subset for passing columns as vectors.
The way you use reprex is around the code that you run— please take a minute to look at either the FAQ, or the quick demo of reprex in the webinar:
Since you haven't assigned your tidied dataframe to anything, there's a disconnect between what shows up when you're running Spectral %>% tidyr::gather("id", "value", 2:638), and the data frame you're passing in to ggplot, which is presumably in whatever format Spectral was in pre-tidying.
Thank you Mara for the insight. I assigned my tidied data to p, which did not really make any difference. The format was still the same prior to the time it was not assigned to anything. I also tried using the reprex and here is the code again with the error message.
You're almost there with the reprex, and then we can run your code to help you out. Because no one else has your hard drive, we don't have your data. We don't need all of it, but if you could put in a small sample (20 or so rows should work) using dput() or another one of the options described in the FAQ, your reproducible example will be self-contained!
Here's a reprex with just the values from head() using the datapasta package for easy tibble pasting.
I didn't use the limits you've specified above, since it's harder to see, but you should be able to add those easily. Note that because Wavelength.(nm) is not a syntactically valid variable name, I had to use backticks around it.