Description Usage Arguments Value Examples
View source: R/setAttributes.R
Attempts to attribute data in a data frame describing data on a grid to a another data frame (with irregular points in x
and y
. The data frame is assumed to have coordinate values as integer values. Hence, If the data-containing data frame describes a spacing of 1, a simple merge is carried out. If not a nearest-grid interpolation is carried out.
1 | attribute_data(df, info_df, miss_value = 0, averaging_box = NA)
|
df |
data frame to which data is attributed. Must contain fields |
info_df |
the data-containing data frame. Must contain fields |
miss_value |
the value attributed to data points which cannot be mapped. |
averaging_box |
a vector of length 4 describing a box around the values which cannot be matched to the data. The missing value will then be replaced with the average of data found in this box. The vector should of the format |
a vector of the data mapped onto the coordinates in df
1 2 3 | df <- data.frame(x=runif(100),y=runif(100))
info_df <- cbind(expand.grid(x=seq(0,1,0.1),y=seq(0,1,0.1)),z=runif(121))
df$z <- attribute_data(df=df,info_df = info_df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.