I have been trying to plot a spectra but I was not successful.
What I have is a file with over 300 columns and 10000 rows (containing intensity information for 300 different signals) and another data with 1 column and 10000 rows (which contains the wavelength measurements corresponding to the 300 signals' intensity levels). I want to plot all 300 columns of intensity data against the wavelength data,
I checked this one Plotting multiple spectra with different colors in a hyperSpec object
but it did not help much, I try to simulate a data which can be used for interpretation
Its <- matrix(rexp(200, rate=0.1),nrow=10000,ncol=300)
Wls <- 1:10000
I tried to put them together first
df <- cbind(Wls,Its)
Then i melt it in order to use the ggplot according to what is commented before,
library(reshape2)
library(ggplot2)
melted data <- melt(df,id.vars = 'V1')
ggplot(melted) +
aes(x=df, y=value, group=variable, color=variable) +
geom_line()
Is there really a good way to plot spectra ?? I really appreciate any help