An expression like "v >= 52", where v is a vector, will produce a vector resulting from comparing each entry -- that is why you see the message.
What you want to do is logical subscripting. For example names <- character( nrow( curveData ) ) names[ curvedata$Date.difference <= 29 ] = "< 1 month" etc. Also, to test for a NULL value do not compare to the string "NULL", use the test operator is.null: names[ is.null( curvedata$Date.difference ) ] = "missing" -- View this message in context: http://n4.nabble.com/Help-with-assigning-a-value-based-on-existing-numbers-tp1692200p1692321.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.