# data partitioning
site15 <- soil %>%
dplyr::select(-year, -elev) %>%
filter(site == soil$site[15]) %>%
arrange(date)
train <- site15 %>%
filter(date < ymd('2018-06-01'))
test <- site15 %>%
filter(date >= ymd('2018-06-01'))
train %>% head()
# A tibble: 6 × 7
site day date temp longitude latitude elevation
<chr> <dbl> <date> <dbl> <dbl> <dbl> <dbl>
1 B21K-1 226 2017-08-14 3.82 -155. 69.6 96
2 B21K-1 227 2017-08-15 3.72 -155. 69.6 96
3 B21K-1 228 2017-08-16 3.31 -155. 69.6 96
4 B21K-1 229 2017-08-17 4.95 -155. 69.6 96
5 B21K-1 230 2017-08-18 5.46 -155. 69.6 96
6 B21K-1 231 2017-08-19 5.80 -155. 69.6 96