Coder Social home page Coder Social logo

openappr's Introduction

openappr

R-CMD-check Codecov test coverage Lifecycle: stable CRAN status license

The goal of openappr is to import app data from OpenAppBuilder.

Installation

You can install the development version of openappr from GitHub with:

# install.packages("devtools")
devtools::install_github("IDEMSInternational/openappr")

About openappr

The use of openappr begins by establishing a connection to ‘OpenAppBuilder’. This can be achieved using the get_app_connection() function, which is simply a wrapper to the dbconnect function from the DBI package. By using the get_app_connection() function, the connection is stored in the package environment, ensuring that subsequent calls to retrieve the app data uses this connection.

The primary functionality of openappr revolves around two main types of data retrieval:

  • Notification Data: Users can retrieve notification-related data using the function get_nf_data(). This function is optimised for quick access to notifications generated by the system, structured to provide immediate insights into user engagement and system performance.

  • User Data: The function get_user_data() is designed to access detailed information about users. This is particularly useful for analysis that requires a deep dive into user behaviour and demographics.

Both functions utilise the underlying capabilities of the RPostgres package but are tailored to provide a more user-friendly interface that requires minimal SQL knowledge.

Example

This is a basic example which shows you how can import notification and 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"
)

Conclusion

The openappr package provides a convenient way to connect to OpenAppBuilder and retrieve data, customise your queries, and filter to suit your data needs.

openappr's People

Contributors

lilyclements avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.