as_fnc_df {Morphoscape} | R Documentation |
Convert a data frame to a fnc_df
Description
as_fnc_df()
converts a data frame containing coordinates and functional charactertics in a morphological space to a fnc_df
object for use in later funcitons, most importantly krige_surf
.
Usage
as_fnc_df(x, func.names = NULL, scale = TRUE)
Arguments
x |
a data frame containing coordinates and functional characteristics (and possibly other variables, which are ignored). The first two columns must correspond to the x and y coordinates of the warps in morphological space. |
func.names |
the names of the variables in |
scale |
whether to scale the functional characteristics to have a minimum of 0 and a maximum of 1. This should generally be left at its default ( |
Details
Input data can be from a sampled grid of locations in morphospace, measured specimen data, species or group means, or a mix.
Value
A fnc_df
object, which is a data.frame
with the x and y coordinates in the first two columns and the functional characteristics in the other columns. The "func.names"
attribute contains the names of the functional characteristics.
See Also
krige_surf
for using an fnc_df
object to create a kriged surface.
Examples
data("warps")
warps_fnc <- as_fnc_df(warps,
func.names = c("hydro", "curve",
"mech", "fea"))
str(warps_fnc)