Re: [R] Using column length in plot gives error

2009-05-17 Thread MikSmith
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

Re: [R] Using column length in plot gives error

2009-05-17 Thread Dieter Menne
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="

Re: [R] Using column length in plot gives error

2009-05-16 Thread Stephanie Kovalchik
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

[R] Using column length in plot gives error

2009-05-15 Thread MikSmith
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"

[R] Using column length in plot gives error

2009-05-15 Thread MikSmith
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"