- using R Under development (unstable) (2024-11-03 r87286)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-14 (Debian 14.2.0-6) 14.2.0
GNU Fortran (Debian 14.2.0-6) 14.2.0
- running under: Debian GNU/Linux trixie/sid
- using session charset: UTF-8
- checking for file ‘dhis2r/DESCRIPTION’ ... OK
- this is package ‘dhis2r’ version ‘0.2.1’
- 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 executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘dhis2r’ can be installed ... OK
See the install log for details.
- checking package directory ... OK
- checking for future file timestamps ... 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/1s] OK
- checking whether the package can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the package can be unloaded cleanly ... [1s/1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s/1s] OK
- checking loading without being on the library search path ... [1s/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 ... [4s/6s] OK
- checking Rd files ... [0s/0s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... 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/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 ... [1s/3s] ERROR
Running examples in ‘dhis2r-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### 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 ... [1s/3s] OK
Running ‘testthat.R’ [1s/3s]
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [3s/6s] OK
- checking PDF version of manual ... [4s/6s] OK
- checking HTML version of manual ... [0s/0s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR