- using R version 4.4.1 (2024-06-14 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 13.2.0
GNU Fortran (GCC) 13.2.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'dhis2r/DESCRIPTION' ... OK
- this is package 'dhis2r' version '0.2.0'
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'dhis2r' can be installed ... OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... OK
- checking 'build' directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s] OK
- checking whether the package can be loaded with stated dependencies ... [1s] OK
- checking whether the package can be unloaded cleanly ... [1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s] OK
- checking loading without being on the library search path ... [1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [3s] OK
- checking Rd files ... [1s] OK
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of 'data' directory ... OK
- checking data for non-ASCII characters ... [0s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... [2s] ERROR
Running examples in 'dhis2r-Ex.R' failed
The error most likely occurred in:
> ### Name: Dhis2r
> ### Title: Connect and pull/get data from a DHIS2 instance
> ### Aliases: Dhis2r
>
> ### ** Examples
>
> # Load dhis2r
> library(dhis2r)
> # connect to the DHIS2 instance
> dhis2_play_connection <- Dhis2r$new(base_url = "https://play.im.dhis2.org/stable-2-40-5",
+ username = "admin",
+ password = "district")
>
> # get all the available resources
> dhis2_play_connection$get_metadata()
[1] "https://play.im.dhis2.org/stable-2-40-5/api/resources"
# A tibble: 89 × 4
displayName singular plural href
<chr> <chr> <chr> <chr>
1 Indicator Groups indicatorGroup indic… http…
2 Organisation Unit Group Sets organisationUnitGroupSet organ… http…
3 Validation Notification Templates validationNotificationTemplate valid… http…
4 Legend Sets legendSet legen… http…
5 Categories category categ… http…
6 Program Data Elements programDataElement progr… http…
7 Tracked Entity Types trackedEntityType track… http…
8 External File Resources externalFileResource exter… http…
9 Program Indicator Groups programIndicatorGroup progr… http…
10 Event Reports eventReport event… http…
# ℹ 79 more rows
>
> # get organisation Units with the default fields i.e c("name","id")
>
> dhis2_play_connection$get_metadata(endpoint = "organisationUnits")
[1] "https://play.im.dhis2.org/stable-2-40-5/api/organisationUnits?fields=name%2Cid"
# A tibble: 5 × 1
`response_data[[1]]`
<named list>
1 <int [1]>
2 <int [1]>
3 <int [1]>
4 <chr [1]>
5 <int [1]>
>
> # get a vector of all possible fields of a organisation unit resource
> dhis2_play_connection$get_metadata_fields(endpoint = "organisationUnits")
[1] "https://play.im.dhis2.org/stable-2-40-5/api/organisationUnits?fields=%3Aall&paging=true&pageSize=1"
[1] "access" "ancestors" "attributeValues"
[4] "children" "code" "created"
[7] "dataSets" "dimensionItem" "dimensionItemType"
[10] "displayFormName" "displayName" "displayShortName"
[13] "externalAccess" "favorite" "favorites"
[16] "href" "id" "lastUpdated"
[19] "leaf" "legendSets" "level"
[22] "name" "openingDate" "organisationUnitGroups"
[25] "parent" "path" "programs"
[28] "sharing" "shortName" "translations"
[31] "userAccesses" "userGroupAccesses" "users"
>
> # get organisation Units with additional fields i.e c("name","id", "level")
>
> dhis2_play_connection$get_metadata(endpoint = "organisationUnits",
+ fields = c("name","id", "level"))
[1] "https://play.im.dhis2.org/stable-2-40-5/api/organisationUnits?fields=name%2Cid%2Clevel"
# A tibble: 5 × 1
`response_data[[1]]`
<named list>
1 <int [1]>
2 <int [1]>
3 <int [1]>
4 <chr [1]>
5 <int [1]>
>
> dhis2_play_connection$get_analytics(analytic = c("Uvn6LCg7dVU"),
+ org_unit = c("O6uvpzGd5pu", "fdc6uOvgoji"),
+ period = "LAST_12_MONTHS",
+ output_scheme = "NAME")
Error in `req_perform()`:
! HTTP 409 Conflict.
Backtrace:
▆
1. └─dhis2_play_connection$get_analytics(...)
2. └─httr2::req_perform(...)
3. └─httr2:::handle_resp(req, resp, error_call = error_call)
4. └─httr2:::resp_abort(resp, req, body, call = error_call)
5. └─rlang::abort(...)
Execution halted
- checking for unstated dependencies in 'tests' ... OK
- checking tests ... [3s] OK
Running 'testthat.R' [2s]
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [2s] ERROR
Error(s) in re-building vignettes:
--- re-building 'dhis2r.Rmd' using rmarkdown
Quitting from lines 36-38 [unnamed-chunk-3] (dhis2r.Rmd)
Error: processing vignette 'dhis2r.Rmd' failed with diagnostics:
HTTP 401 Unauthorized.
--- failed re-building 'dhis2r.Rmd'
SUMMARY: processing the following file failed:
'dhis2r.Rmd'
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [21s] OK
- checking HTML version of manual ... [1s] OK
- DONE
Status: 2 ERRORs