Re: [R] Issue with Transform function in R

2016-07-21 Thread tom
Not sure I can translate the format of your Date column correctly, however the command DF1$Date <- as.Date(DF1$Date, format=’formatstr’) Will convert the dates into a format correctly handled by R. ?strptime Should give you an idea of what formatstr should look like. I.e. if date = 160721

Re: [R] Issue with Transform function in R

2016-07-21 Thread Ivan Calandra
Oops, missed that one! -- Ivan Calandra, PhD Scientific Mediator University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros 51100 Reims, France +33(0)3 26 77 36 89 ivan.calan...@univ-reims.fr -- https://www.researchgate.net/profile/Ivan_Calandra

Re: [R] Issue with Transform function in R

2016-07-21 Thread ruipbarradas
Hello, Another thing to consider is to use Variable1 = NA, not '=='. With '==' it will probably return TRUE/FALSE/NA. Hope this helps, Rui Barradas   Citando Ivan Calandra : > This might not be the whole story, but part of the problem is that > you want to

Re: [R] Issue with Transform function in R

2016-07-21 Thread Ivan Calandra
This might not be the whole story, but part of the problem is that you want to select a _*character string*_ greater/smaller than another. That doesn't make much sense! I am not sure how to best compare two dates, but if you convert the Date values into numeric, then that would work. The

[R] Issue with Transform function in R

2016-07-21 Thread Bhaskar Mitra
Hello Everyone, I am trying to replace the values in the 2nd column (Variable 1) corresponding to certain dates (Date) with NAs as shown below. Both Date and Variable1 are numeric vectors . I am trying to use the transform function as shown below but it doesn’t seem to work even though if I