Description Usage Arguments Value
View source: R/convert_spdf_for_ggplot2.r
A helper function that converts the SpatialPointDataFrame to a long-form output format plottable in ggplot2. In the context of spcv it is useful for plotting the output of gstat::idw(). The var_name argument defaults to "var1.pred" the column of interpolation predictions produced by gstat::idw(). This variable is renamed to "z" in the output data.frame.
1 | convert_spdf_for_ggplot2(df.sp, var_name = "var1.pred")
|
df.sp |
a SpatialPointsDataFrame object (for more info on this class of object see the sp package) |
var_name |
a string object specifying the column in the SpatialPointsDataFrame containing the variable to be defined as z in the ggplot ready output data.frame |
df a data.frame object in long from for compatability with ggplot2; the var_name of interest is renamed z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.