Hi Stephanie
Absolutely right! My CSV was imported as a factor. Reading the R FAQ:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f
I actually need to do:
as.numeric(as.character(spectra.wavelength))
to get back to my original data.
Many thanks for the po
MikSmith hsm.org.uk> writes:
> I'm trying to write a generic script for processing some data which finishes
> off with some plots. Given Im never sure how many columns will be in my
> dataframe I wanted to using the following
>
> plot(spectra.wavelength, cormat, type = "l", ylim=c(-1,1), xlab="
Is spectra.wavelength a factor? If so, plot will treat it as
categorical and not draw a line. Try the following modification.
plot(as.numeric(spectra.wavelength), cormat, type = "l", ylim=c(-1,1),
xlab="Wavelength (nm)", ylab="Correlation")
Quoting MikSmith :
Hi
I'm trying to write a ge
Hi
I'm trying to write a generic script for processing some data which finishes
off with some plots. Given Im never sure how many columns will be in my
dataframe I wanted to using the following
plot(spectra.wavelength, cormat, type = "l", ylim=c(-1,1), xlab="Wavelength
(nm)", ylab="Correlation"
Hi
I'm trying to write a generic script for processing some data which finishes
off with some plots. Given Im never sure how many columns will be in my
dataframe I wanted to using the following
plot(spectra.wavelength, cormat, type = "l", ylim=c(-1,1), xlab="Wavelength
(nm)", ylab="Correlation"
5 matches
Mail list logo