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