Skip to content
Prev 259175 / 398502 Next

replace NA

Hi,

If your geology map is a special kind of object, this may not work,
but if you are just dealing with a data frame or matrix type object
named, "geology" with columns, something like this ought to do the
trick:

geology[is.na(geology[, "landform"]), "landform"] <- 0

?is.na returns a logical vector of TRUE/FALSE whether a value is
missing which is used to index the data and then 0 is assigned to all
those positions.

HTH,

Josh
On Fri, May 6, 2011 at 1:12 PM, azam jaafari <azamjaafari at yahoo.com> wrote: