pol_cropping: assign site to pol by st_intersection()

Description Usage Examples

View source: R/pol_cropping.R

Description

assign site to pol by st_intersection()

Usage

1
pol_cropping(data_stN = NULL, pol = NULL, parm_nm = "parm_nm")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(water_Temperature_sf)
data(corn_yield_sf)
corn_yield_st <- corn_yield_sf
water_Temperature_st <- water_Temperature_sf

pol <- corn_yield_st %>%
     st_transform(2163) %>%
  rename(target = data) %>%
  nest(data = c(geometry)) %>%
  rename(pol = data) %>%
  filter(county == "polk") ;pol
  # humboldt for none; allamakee for one; boone for two
pol <- pol$pol[[1]]; pol
data_stN <- water_Temperature_st %>% st_transform(2163)
parm_nm = "watertem"
plot(st_geometry(pol))
plot(st_geometry(data_stN), add = TRUE)
pol_cropping(data_stN = water_Temperature_st, pol = pol, parm_nm = "watertem")

WeiquanLuo/stNet documentation built on Nov. 24, 2019, 5:11 p.m.