The goal ofopenappr is to import app data fromOpenAppBuilder.
You can install the development version of openappr fromGitHub with:
# install.packages("devtools")devtools::install_github("IDEMSInternational/openappr")openapprThe use ofopenappr begins by establishing a connectionto ‘OpenAppBuilder’. This can be achieved using theget_app_connection() function, which is simply a wrapper tothedbconnect function from theDBI package.By using theget_app_connection() function, the connectionis stored in the package environment, ensuring that subsequent calls toretrieve the app data uses this connection.
The primary functionality ofopenappr revolves aroundtwo main types of data retrieval:
Notification Data: Users can retrieve notification-related datausing the functionget_nf_data(). This function isoptimised for quick access to notifications generated by the system,structured to provide immediate insights into user engagement and systemperformance.
User Data: The functionget_user_data() is designedto access detailed information about users. This is particularly usefulfor analysis that requires a deep dive into user behaviour anddemographics.
Both functions utilise the underlying capabilities of theRPostgres package but are tailored to provide a moreuser-friendly interface that requires minimal SQL knowledge.
This is a basic example which shows you how can import notificationand user data from open-app builder into R:
# Before retrieving data, you must establish a connection to your OpenAppBuilder (PostgreSQL) database using the `set_app_connection()` function:openappr::set_app_connection(dbname ="vmc",host ="apps-server.idems.international",port =5432,user ="vmc",password ="LSQkyYg5KzL747")# Once the connection is established, you can retrieve it at any time using the get_app_connection() function:con<-get_app_connection()# For specific user data, use the `get_user_data()` function:valid_ids<-c("3e68fcda-d4cd-400e-8b12-6ddfabced348","223925c7-443a-411c-aa2a-a394f991dd52")data_filtered_notifications<-get_openapp_data(name ="app_users",filter =TRUE,filter_variable ="app_user_id",filter_variable_value = valid_ids)# Similarly, the `get_nf_data()` function allows you to retrieve and process notification interaction data:filtered_notification_data<-get_nf_data(filter =TRUE,filter_variable ="Country",filter_variable_value ="USA")Theopenappr package provides a convenient way toconnect to OpenAppBuilder and retrieve data, customise your queries, andfilter to suit your data needs.