mps9506 / rattains Goto Github PK
View Code? Open in Web Editor NEW:droplet: Access EPA ATTAINS data in R :droplet:
Home Page: https://mps9506.github.io/rATTAINS/
License: Other
:droplet: Access EPA ATTAINS data in R :droplet:
Home Page: https://mps9506.github.io/rATTAINS/
License: Other
Prepare for release:
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('patch')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
Prepare for release:
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('patch')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
Errors on r-devel-linux-x86_64-debian-gcc, r-release-macos-x86_64, r-oldrel-macos-x86_64 during CRAN checks.
Flavor: r-devel-linux-x86_64-debian-gcc:
Version: 0.1.0
Check: tests
Result: ERROR
Running βtestthat.Rβ [10s/15s]
Running the tests in βtests/testthat.Rβ failed.
Complete output:
> library(testthat)
> library(rATTAINS)
>
> test_check("rATTAINS")
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/actions/R8-ND-2018-03_N_Nactions.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessmentUnits/AL03150201-0107-200assessmentUnits.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessmentUnits/AL03150201-0107-200assessmentUnits.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessments/SDDENR_GRAZING_IN_RIPARIAN_OR_SHORELINE_ZONES_N_Nassessments.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessments/SDDENR_GRAZING_IN_RIPARIAN_OR_SHORELINE_ZONES_N_Nassessments.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/huc12summary/020700100204huc12.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/huc12summary/020700100204huc12.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/plans/020700100103_Nplans.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/plans/020700100103_Nplans.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/surveys/SDDENRsurveys.json
reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/surveys/SDDENRsurveys.json
ββ Failed tests ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Error (test-actions.R:3:3): actions webservice works ββββββββββββββββββββββββ
Error: Column `agencyCode` not found in `.data`
Backtrace:
β
1. ββvcr::use_cassette(...) test-actions.R:3:2
2. β ββcassette$call_block(...)
3. ββrATTAINS::actions(action_id = "R8-ND-2018-03") test-actions.R:4:4
4. β ββrATTAINS:::actions_to_tibble(...)
5. β ββ`%>%`(...)
6. ββjanitor::clean_names(.)
7. ββtibble::as_tibble(.)
8. ββdplyr::select(., -c(.data$array.index))
9. ββtidyjson::spread_all(., recursive = TRUE)
10. β ββtidyjson::is.tbl_json(.x)
11. ββtidyjson::gather_array(.)
12. β ββassertthat::assert_that(!("..name" %in% names(.x)))
13. β β ββassertthat::see_if(..., env = env, msg = msg)
14. β β ββbase::tryCatch(...)
15. β β β ββbase:::tryCatchList(expr, classes, parentenv, handlers)
16. β β β ββbase:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
17. β β β ββbase:::doTryCatch(return(expr), name, parentenv, handler)
18. β β ββbase::eval(assertion, env)
19. β β ββbase::eval(assertion, env)
20. β ββ"..name" %in% names(.x)
21. ββtidyjson::enter_object(., "documentTypes")
22. β ββtidyjson::is.tbl_json(.x)
23. ββdplyr::select(., -c(.data$array.index))
24. ββtidyjson::spread_all(.)
25. β ββtidyjson::is.tbl_json(.x)
26. ββtidyjson::gather_array(.)
27. β ββassertthat::assert_that(!("..name" %in% names(.x)))
28. β β ββassertthat::see_if(..., env = env, msg = msg)
29. β β ββbase::tryCatch(...)
30. β β β ββbase:::tryCatchList(expr, classes, parentenv, handlers)
31. β β β ββbase:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
32. β β β ββbase:::doTryCatch(return(expr), name, parentenv, handler)
33. β β ββbase::eval(assertion, env)
34. β β ββbase::eval(assertion, env)
35. β ββ"..name" %in% names(.x)
36. ββtidyjson::enter_object(., "documents")
37. β ββtidyjson::is.tbl_json(.x)
38. ββdplyr::rename(., agencyCode_1 = .data$agencyCode)
39. ββdplyr:::rename.data.frame(., agencyCode_1 = .data$agencyCode)
40. β ββtidyselect::eval_rename(expr(c(...)), .data)
41. β ββtidyselect:::rename_impl(...)
42. β ββtidyselect:::eval_select_impl(...)
43. β ββtidyselect:::with_subscript_errors(...)
44. β β ββbase::tryCatch(...)
45. β β β ββbase:::tryCatchList(expr, classes, parentenv, handlers)
46. β β β ββbase:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
47. β β β ββbase:::doTryCatch(return(expr), name, parentenv, handler)
48. β β ββtidyselect:::instrument_base_errors(expr)
49. β β ββbase::withCallingHandlers(...)
50. β ββtidyselect:::vars_select_eval(...)
51. β ββtidyselect:::walk_data_tree(expr, data_mask, context_mask)
52. β ββtidyselect:::eval_c(expr, data_mask, context_mask)
53. β ββtidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
54. β ββtidyselect:::walk_data_tree(new, data_mask, context_mask)
55. β ββbase::eval(expr, data_mask)
56. β ββbase::eval(expr, data_mask)
57. β ββagencyCode
58. β ββrlang:::`$.rlang_data_pronoun`(.data, agencyCode)
59. β ββrlang:::data_pronoun_get(x, nm)
60. ββrlang:::abort_data_pronoun(x)
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 43 ]
Error: Test failures
Execution halted
Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64
Version: 0.1.0
Check: tests
Result: ERROR
Running βtestthat.Rβ [3s/3s]
Running the tests in βtests/testthat.Rβ failed.
Last 13 lines of output:
42. β ββtidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
43. β ββtidyselect:::walk_data_tree(new, data_mask, context_mask)
44. β ββtidyselect:::eval_c(expr, data_mask, context_mask)
45. β ββtidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
46. β ββtidyselect:::walk_data_tree(new, data_mask, context_mask)
47. β ββbase::eval(expr, data_mask)
48. β ββbase::eval(expr, data_mask)
49. β ββagencyCode
50. β ββrlang:::`$.rlang_data_pronoun`(.data, agencyCode)
51. β ββrlang:::data_pronoun_get(x, nm)
52. ββrlang:::abort_data_pronoun(x)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 39 ]
Error: Test failures
Execution halted
Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64
Version: 0.1.0
Check: re-building of vignette outputs
Result: WARN
Error(s) in re-building vignettes:
...
--- re-building βIntroduction.Rmdβ using rmarkdown
Warning in engine$weave(file, quiet = quiet, encoding = enc) :
Pandoc (>= 1.12.3) not available. Falling back to R Markdown v1.
reading cached file from: ~/Library/Caches/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
Quitting from lines 60-61 (Introduction.Rmd)
Error: processing vignette 'Introduction.Rmd' failed with diagnostics:
subscript out of bounds
--- failed re-building βIntroduction.Rmdβ
SUMMARY: processing the following file failed:
βIntroduction.Rmdβ
Error: Vignette re-building failed.
Execution halted
Prepare for release:
git pull
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check()
cran-comments.md
git push
Submit to CRAN:
usethis::use_version('patch')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
usethis::use_dev_version()
git push
Warning message:
package 'testthat' was built under R version 4.2.2
[ FAIL 0 | WARN 1 | SKIP 0 | PASS 53 ]
ββ Warnings ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Warning ('test-plans.R:3'): plans works βββββββββββββββββββββββββββββββββββββ
array.index column name already exists, changing to array.index.2
Backtrace:
1. vcr::use_cassette(...)
at test-plans.R:3:2
11. tidyjson::gather_array(.)
[ FAIL 0 | WARN 1 | SKIP 0 | PASS 53 ]
Warning message:
package 'vcr' was built under R version 4.2.2
Tests complete
First release:
usethis::use_cran_comments()
Title:
and Description:
@returns
and @examples
Authors@R:
includes a copyright holder (role 'cph')Prepare for release:
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
Prepare for release:
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('patch')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
CRAN seems to have a moving policy on allowing package to write to user directories, or at least where packages can write to.
Suggest removing caching functions and including documentation for users to cache api calls themselves.
Switching to tibblify in the dev version facilitates returning consistent data structures from the API regardless of missing data returned by EPA's API. My initial design choice was to return data as unnested as possible, thinking it is easier for users to avoid unnest operations. tidyr's unnest()
, unnest_wider()
, unnest_longer()
, probably makes it much easier for new users to unnest data now.
It is much harder to go the other direction (nesting data) without knowing what variables to group by however! Currently working on a project where I only want the high level data (nested grouped variables) and it is very much a pain to remember what variables to group by.
Options:
Hi -- I'm interested in exploring EPA ATTAINS records for multiple states in the Northeast US.
## R version 4.1.0
library(rATTAINS) ## 0.1.3.9999
library(dplyr) ## 1.0.7
domain_values(domain_name = "OrgStateCode") %>%
filter(code %in% c("RI")) %>%
pull(context)
## [1] "RIDEM" "EPA"
state_summary(organization_id = "RIDEM")
## Error: Can't coerce element 10 from a list to a character
## Whereas, when the code is not tidy it returns data
head(state_summary(organization_id = "RIDEM", tidy = FALSE))
Please let me know if you need additional information to make sure the code above is reproducible.
Use pkgdown template from mpsTemplates.
Prepare for release:
git pull
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
cran-comments.md
git push
Submit to CRAN:
usethis::use_version('major')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
git push
Getting the following test failure on CRAN
checking tests ... [17s/44s] ERROR
Running βtestthat.Rβ [17s/43s]
Running the tests in βtests/testthat.Rβ failed.
Complete output:
> library(testthat)
> library(rATTAINS)
>
> test_check("rATTAINS")
no files found
no files found
no files found
no files found
no files found
no files found
no files found
no files found
ββ Skipped tests βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β’ On CRAN (6)
ββ Failed tests ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Error (test-huc12_summary.R:14:3): huc_12 works βββββββββββββββββββββββββββββ
Error in `curl::curl_fetch_memory(x$url$url, handle = x$url$handle)`: Timeout was reached: [attains.epa.gov] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received
Backtrace:
β
1. ββrATTAINS::huc12_summary(huc = "020700100204", tidy = FALSE) test-huc12_summary.R:14:2
2. ββrATTAINS:::xGET(path, args, file = NULL, ...)
3. ββcli$get(path = path, query = args)
4. ββprivate$make_request(rr)
5. ββcrul:::crul_fetch(opts)
6. ββcurl::curl_fetch_memory(x$url$url, handle = x$url$handle)
[ FAIL 1 | WARN 0 | SKIP 6 | PASS 38 ]
Error: Test failures
Execution halted
This is odd because {vcr} is used and the tests should be returning the information in the cassettes. We aren't actually making external internet calls in the test. This works locally if I don't have an internet connection.
Further, the information returned in the error message is deemed unhelpful by CRAN so in this error case they want improved error messaging. Even with an informative error message, the test would have failed.
The empty folders created by the caching logic are not allowed by CRAN.
Not 100% sure why this doesn't trigger the other Checks, but possibly try with:
_R_CHECK_DONTTEST_EXAMPLES_=true
Hello,
I am hoping to use this package to query the ATTAINS data for specific areas across the eastern United States. I think most of the data I'm interested in is in the use_assessment tibble produced by assessments(), but I'm having difficulty using the assessments() function with assessment_unit_id designated. I would also like to know EPA IR categories since ~2010, which I think means I'll need to run assessments() multiple times, as shown in your example tutorial (though at the state level).
I can only get the assessments() function to complete a query with an assessment_unit_id listed when both state_code and organization_id are also listed. Is this the expected function? I also run into an error when I try to specify any reporting cycle other than 2020 (which I think is the most recent one based on the default arguments). Adding any agency_code arguments doesn't affect the error.
assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY') # works assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY', reporting_cycle='2020') # works assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY', reporting_cycle='2016') # does not work
The error I recieve is : "Error in dplyr::select()
:
! Can't subset columns that don't exist.
x Column agencyCode
doesn't exist.
Run rlang::last_error()
to see where the error occurred. "
I downloaded the CRAN version of the package this morning and am running R version 4.1.1 on Windows.
I appreciate your help with this issue and for writing this package! It is going to immensely help and speed up the process -- we have about 70 sites across 13 states. Thanks!
Traci
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.