create_performance_review: Create a responsematch 'Shiny' Survey Performance Review

View source: R/create_performance-assessment.R

create_performance_reviewR Documentation

Create a responsematch 'Shiny' Survey Performance Review

Description

This function can be used to create a Shiny Survey application. It takes in two parameters: name, which specifies the name of the performance review and path, which specifies where the application should be created.

Usage

create_performance_review(
  name,
  path,
  include_employee_setup_app,
  employee_data,
  encryption_key = NULL,
  password_length = 6
)

Arguments

name

The name of the survey application to create

path

The path specifying where the survey application should be created. Default is the current working directory.

include_employee_setup_app

Logical: TRUE and a Shiny app allowing employees to select their manager and peers will be created.

employee_data

A data frame with columns "full_name" and "email" for all employees included in the performance review.

encryption_key

A character string used to encrypt the employees' names into passwords. This should be kept secret. If NULL (default), the environmental variable RESPONSEMATCH_ENCRYPT_KEY is checked.

password_length

The length of the passwords created for each user. Defaults to six.

Details

Assuming the data should be stored to Google Drive/Google Sheets (see function arguments for more details), running this function will result in your internet browser will open and you will be asked to authenticate your Google Drive and Google Sheets information. This is necessary to remotely store respondent's data.

After Google Drive and Google Sheets authentication, a new RStudioProjecthttps://r4ds.had.co.nz/workflow-projects.html will be created at the specified path, with a suffix 'survey-project'.

The RStudio project will open in a new R Session automatically. In the file pane, there will be a folder with a suffix '-app', containing an 'app.R' file – defining the user-interface and server-side logic of the survey – a 'www' folder – housing some example questions, RMarkdown reports, and custom JavaScript – and an 'R' directory containing additional functions used by the application.

The Shiny application is fully functioning at this point, however, you must modify the survey questions and parameterized RMarkdown report located in the 'www' subdirectory.

In order to deploy the survey to shinyapps.io, you may click the 'deploy' button at the top right of the RStudio IDE. For more details on deployment, please see my blog post on getting started with[shinyapps.io]https://www.jdtrat.com/blog/getting-started-shinyapps/.

Value

A new RStudio Project the infrastructure needed to launch a new performance review in Shiny.

Examples


if (interactive()) {
  create_performance_review(name = "testPerformanceReview")

  create_performance_review(
    name = "testPerformanceReview",
    path = "~/Desktop/",
    include_employe_setup_app = TRUE,
    employee_data = data.frame(
      full_name = c("First Next", "Second Last"),
      email = c("name@website.com", "name2@website.com")
    ),
    encryption_key = "superSecretEncryptionPassword",
    password_length = 6
  )
}


jdtrat/responsematch documentation built on Sept. 15, 2022, 6:19 a.m.