Skip to content
Prev 311560 / 398503 Next

ifelse + numeric

Try leaving the quote marks off the NA:

data[,4] <- ifelse(data[,3]<1,data[,1]/(1-data[,3]),NA)

You are putting a character value with the "NA" which converts
everything else to a character.  If you had examined the dataframe
with 'str(data)' you would probably have seen the problem.
On Wed, Nov 21, 2012 at 5:34 PM, djbanana <karl79264219 at gmail.com> wrote: