View source: R/create_performance-assessment.R
create_performance_review | R Documentation |
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.
create_performance_review( name, path, include_employee_setup_app, employee_data, encryption_key = NULL, password_length = 6 )
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: |
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 |
password_length |
The length of the passwords created for each user. Defaults to six. |
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/.
A new RStudio Project the infrastructure needed to launch a new performance review in Shiny.
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 ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.