Description Usage Arguments Value Examples
View source: R/setAttributes.R
Takes a data frame df
with fields x
and y
and a shape in data frame format, shape_table
, and determines whether, and in which, polygon each point in df
lies.
1 | attribute_polygon(df, shape_df)
|
df |
data frame to which the polygon id is attributed. Must contain fields |
shape_df |
the polygon-containing data frame. Must contain fields |
a vector of length nrow(df)
indicating the id in which each point in df
lies.
1 2 3 4 5 | df <- data.frame(x=c(0.2,1),y=c(0.2,1))
shape_df <- data.frame(x=c(0,0,0.5,0.5),
y = c(0,0.5,0.5,0),
id = 1)
df$id <- attribute_polygon(df,shape_df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.