Skip to content

Commit

Permalink
fix #372 fix arc2 internal function - along with remove sf package fr…
Browse files Browse the repository at this point in the history
…om suggests

sf was in arc2 test, but not needed AFAICT
  • Loading branch information
sckott committed Oct 5, 2020
1 parent e61a825 commit 4d9ab30
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Suggests:
raster,
leaflet,
rgdal,
sf,
rmarkdown,
purrr,
ggmap,
Expand Down
3 changes: 2 additions & 1 deletion R/arc2.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ arc2 <- function(date, box = NULL, ...) {
}

filter_split <- function(x, box) {
df <- dplyr::filter(x, dplyr::between(lon, 9, 10), dplyr::between(lat, 4, 5))
df <- dplyr::filter(x, dplyr::between(lon, box[1], box[3]),
dplyr::between(lat, box[2], box[4]))
split(df, df$date)
}

Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/arc2_bounding_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ http_interactions:
encoding: ''
string: ''
headers:
User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0
User-Agent: libcurl/7.72.0 r-curl/4.3 crul/1.0.0
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*
Authorization: Basic anonymous:[email protected]
Expand All @@ -22,16 +22,16 @@ http_interactions:
encoding: UTF-8
file: yes
string: ../files/daily_clim.bin.19830101.gz
recorded_at: 2020-05-28 18:12:10 GMT
recorded_with: vcr/0.5.4, webmockr/0.6.2
recorded_at: 2020-10-05 15:29:10 GMT
recorded_with: vcr/0.5.4, webmockr/0.7.0
- request:
method: get
uri: ftp://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/bin/daily_clim.bin.19900205.gz
body:
encoding: ''
string: ''
headers:
User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0
User-Agent: libcurl/7.72.0 r-curl/4.3 crul/1.0.0
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*
Authorization: Basic anonymous:[email protected]
Expand All @@ -47,5 +47,5 @@ http_interactions:
encoding: UTF-8
file: yes
string: ../files/daily_clim.bin.19900205.gz
recorded_at: 2020-05-28 18:12:10 GMT
recorded_with: vcr/0.5.4, webmockr/0.6.2
recorded_at: 2020-10-05 15:29:10 GMT
recorded_with: vcr/0.5.4, webmockr/0.7.0
1 change: 0 additions & 1 deletion tests/testthat/test-arc2.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ test_that("arc2 - bounding box works", {
skip_on_cran()
skip_on_ci()
skip_if_government_down()
skip_if_not_installed("sf")

vcr::use_cassette("arc2_bounding_box", {
box <- c(xmin = 9, ymin = 4, xmax = 10, ymax = 5)
Expand Down

0 comments on commit 4d9ab30

Please sign in to comment.