Skip to contents

splnr_replace_NAs() allows you to replace NA values in your data with the value of the nearest neighbor. The nearest neighbor is determined using st_nearest_feature() from the sf package.

Usage

splnr_replace_NAs(df, vari)

Arguments

df

An sf dataframe

vari

Variable to remove NAs from

Value

An sf object with NAs replaced with the nearest neighbour

Examples

df <- dat_species_prob %>%
  splnr_replace_NAs("Spp2")