Convert your column to numeric:

CEM1_PARTIAL$V3 <- as.numeric(as.character(CEM1_PARTIAL$V3))


On Mon, Dec 27, 2010 at 4:28 PM, R_novice <kasojim@battelle.org> wrote:

>
> Thank you for the quick response :-). I've applied your suggestion to my
> code, but I still receive an error:
>
> > CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 == "DOWN") - 1] <-
> > CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 == "DOWN") - 1] * -1
> Warning message:
> In Ops.factor(CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 == "DOWN") -  :
>  * not meaningful for factors
>
> I would like to perform this evaluation in a loop b/c my data matrix
> actually contains 109 columns, and 32,000 rows.
>
> More suggestions are appreciated!
>
> Thanks!
> --
> View this message in context:
> http://r.789695.n4.nabble.com/matrix-looping-accessing-previous-column-tp3165308p3165325.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]

