I am trying visualize a data set using ggplot2 but getting the above error. Here is the code I am using

Spectral <- read_excel("spectralData02.xlsx", sheet=1, col_name = TRUE)

library(ggplot2)

library(tidyverse)

library(plotly)

(packageVersion("ggplot2") <= "2.2.1")

Spectral %>% tidyr::gather("id", "value", 2:638)

Spectral[1]

dim(Spectral)

df <- ggplot(Spectral, aes (Spectral[1], Spectral[3]) ) + geom_line() + scale_x_continuous(limits = c(100, 1000)) + scale_y_continuous(limits = c(0, 2000))

df

Here is what the dataset Spectral looks like.

A tibble: 633,178 x 3

`Wavelength (nm)`

id value

1 338. Brw_MISP_09_PL_199_11:00_2017_REFL 6.46

2 340. Brw_MISP_09_PL_199_11:00_2017_REFL 6.36

3 341. Brw_MISP_09_PL_199_11:00_2017_REFL 6.44

4 342. Brw_MISP_09_PL_199_11:00_2017_REFL 6.39

5 344 Brw_MISP_09_PL_199_11:00_2017_REFL 6.39

6 346. Brw_MISP_09_PL_199_11:00_2017_REFL 6.4

7 347 Brw_MISP_09_PL_199_11:00_2017_REFL 6.37

8 348. Brw_MISP_09_PL_199_11:00_2017_REFL 6.37

9 350. Brw_MISP_09_PL_199_11:00_2017_REFL 6.34

10 351. Brw_MISP_09_PL_199_11:00_2017_REFL 6.4