Description Usage Arguments Details Value Author(s) Examples
returns shiny apps that can be used as a complement to the annual reports from the cancer quality registries in Sweden.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | rccShiny(language = "sv", data = NULL, outcome = "outcome",
outcomeNumericExcludeNeg = TRUE, outcomeTitle = outcome,
folder = "ind", folderLinkText = NULL, path = getwd(),
textBeforeSubtitle = NULL, textAfterSubtitle = NULL, comment = "",
description = rep(NA, 3), geoUnitsHospital = "sjukhus",
geoUnitsCounty = "landsting", geoUnitsRegion = "region",
geoUnitsPatient = FALSE, regionSelection = TRUE,
regionLabel = rccShinyTXT(language = language)$limitRegion,
period = "period", periodDateLevel = "year",
periodLabel = rccShinyTXT(language = language)$dxYear,
varOther = NULL, targetValues = NULL, funnelplot = FALSE,
sortDescending = NULL, propWithinShow = TRUE,
propWithinUnit = rccShinyTXT(language = language)$propWithinUnit,
propWithinValue = 30, hideLessThan = 5, showHide = TRUE,
gaPath = NULL, npcrGroupPrivateOthers = FALSE)
|
language |
vector giving the language for the app. Possible values are "sv" and "en". Default is "sv". See details. |
data |
data frame containing the variables used. |
outcome |
vector with names(s) of variable(s) in data containing the variable(s) to be presented in the app, for example a quality indicator. Variable(s) must be of type logical, factor or numeric. Default is "outcome". Observe that observations with missing values for outcome are not included in the output. |
outcomeNumericExcludeNeg |
should negative values be excluded when presenting a numeric outcome? Particularly relevant for waiting times. Default is TRUE. |
outcomeTitle |
label(s) of the outcome(s) shown in the app. Must be the same length as argument outcome. Default is argument outcome. |
folder |
name of folder where the results are placed. Default is "ind". |
folderLinkText |
name displayed in ready-to-use html link returned by the function. Default is NULL, which results in the use of arguments outcomeTitle, folder and language to construct a name depending on the number of outcomes. |
path |
search path to folder returned by the function. Default is working directory. |
textBeforeSubtitle |
optional text placed before the subtitles in the tabs. |
textAfterSubtitle |
optional text placed after the subtitles in the tabs. |
comment |
optional comment printed under the sidebar panel. |
description |
vector of 3 character strings, or a list of vectors, one for each language, shown in the three subsections in the tab Beskrivning/Description. Default is c(NA, NA, NA). |
geoUnitsHospital |
optional name of variable in data containing hospital names. Variable must be of type character. If NULL or if "sjukhus" is not found in 'data', hospital is not available as a level of presentation. At least one geoUnit must be given. To be implemented: Hospital codes. |
geoUnitsCounty |
optional name of variable in data containing county codes. Variable must be of type numeric. Can be either county of residence for the patient or the county the hospital belongs to. See details for valid values. If NULL or if "landsting" is not found in 'data', county is not available as a level of presentation. At least one geoUnit must be given. To be implemented: Codes for county of hospital are fetched automatically from hospital codes. |
geoUnitsRegion |
optional name of variable in data containing region codes (1=Stockholm, 2=Uppsala-Örebro, 3=Sydöstra, 4=Södra, 5=Västra, 6=Norra, NA=Uppgift saknas). Variable must be of type numeric. Can be either region of residence for the patient or the region the hospital belongs to. If NULL or if "region" is not found in 'data', region is not available as a level of presentation. At least one geoUnit must be given. To be implemented: Codes for region of hospital are fetched automatically from hospital codes. |
geoUnitsPatient |
if geoUnitsCounty/geoUnitsRegion is county/region of residence for the patient (LKF). If FALSE and a hospital is chosen by the user in the sidebar panel the output is highlighted for the respective county/region that the hospital belongs to. Default is FALSE. |
regionSelection |
adds a widget to the sidebar panel with the option to show only one region at a time. Default is TRUE. |
regionLabel |
if regionSelection = TRUE label of widget shown in the sidebar panel. Default is "Begränsa till region", "Limit to region" depending on language. |
period |
name of variable in data containing time periods, for example date or year of diagnosis. Variable must be of type numeric or Date. Default is "period". If period = NULL then no period variable is required and period will not be included anywhere in the Shiny app. |
periodDateLevel |
If the variable in data containing time period is of type Date, how are the time periods going to be grouped? Allowed values are "year and "quarter", with default "year". |
periodLabel |
label for the period widget in the sidebar panal. Default is "Diagnosår", "Year of diagnosis" depending on language. |
varOther |
optional list of variable(s), other than period and geoUnits, to be shown in the sidebar panel. Arguments to the list are: var (name of variable in data), label (label shown over widget in sidebar panel), choices (which values of var should be shown, min, max for continuous variables), selected (which values should be selected when app is launched, default is all avalible values), multiple (should multiple choises be availible, default is TRUE), showInTitle (should selection be displayed in subtitle, default is TRUE). Observe that observations with missing values for varOthers are not included in the output. |
targetValues |
optional vector or list of vectors (one for each outcome) with 1-2 target levels to be plotted in the tabs Jämförelse/Comparison and Trend for outcomes of type logical or numeric. If the outcome is numeric the target levels are shown when "Andel inom..."/"Proportion within..." is selected, and then only for the default propWithinValue. |
funnelplot |
adds a widget to the sidebar panel with the option to show a funnel plot in the tab Jämförelse/Comparison. Only applicaple for dichotomous variables. Default is FALSE. |
sortDescending |
should the bars in tab Jämförelse/Comparison be plotted in descending order? The argument could have the same length as argument outcome, giving different values for each outcome. Default is NULL, which sorts logical outcomes in descending order and continuous outcomes in ascending order. |
propWithinShow |
display the choice "Andel inom..."/"Proportion within..." for numeric outcome(s). Default is TRUE. |
propWithinUnit |
unit shown for numeric outcome when "Andel inom..."/"Proportion within..." is selected. Default is "dagar", "days" depending on language. |
propWithinValue |
vector with default value(s) shown for numeric outcome(s) when "Andel inom..."/"Proportion within..." is selected. If the length of the vector is less than the number of numeric outcomes the values are recycled. Default is 30. |
hideLessThan |
value under which groups (cells) are supressed. Default is 5 and all values < 5 are set to 5. |
showHide |
To be implemented: Should levels with values < 5 be shown but without values? Default is TRUE. |
gaPath |
optional path to Google Analytics .js-file. Default is NULL. |
npcrGroupPrivateOthers |
should private hospitals be grouped when displaying data for the entire country. Applicable for NPCR. Default is FALSE. |
Valid values for geoUnitsCounty are:
geoUnitsPatient | !geoUnitsPatient | Text shown |
1 | 10,11 | Stockholm |
3 | 12 | Uppsala |
4 | 13 | Södermanland |
5 | 21 | Östergötland |
6 | 22 | Jönköping |
7 | 23 | Kronoberg |
8 | 24,25 | Kalmar |
9 | 26 | Gotland |
10 | 27 | Blekinge |
12 | 28,30,41 | Skåne |
13 | 42 | Halland |
14 | 50,51,52,53 | Västra Götaland |
17 | 54 | Värmland |
18 | 55 | Örebro |
19 | 56 | Västmanland |
20 | 57 | Dalarna |
21 | 61 | Gävleborg |
22 | 62 | Västernorrland |
23 | 63 | Jämtland |
24 | 64 | Västerbotten |
25 | 65 | Norrbotten |
- | 91,92,93,94,95,96 | Övriga/privata - region |
NA | NA | Uppgift saknas |
If language = c("sv", "en") the following applies to arguments: textBeforeSubtitle, textAfterSubtitle, comment, regionLabel, label in list varOther: if there are two values the first is used in the Swedish version and the second in the English version. If there is only one value this is recycled in both versions. The following applies to argument outcomeTitle, description: the arguments should be given in a list, the first listargument is used in the Swedish version and the second in the English version. The Swedish title(s) will be recycled if English is missing. The following applies to arguments outcome, geoUnitsHospital, geoUnitsCounty, geoUnitsRegion, period, var in list varOther: in the English version the variable name with the suffix _en (for example "outcome_en") will be used if this exists and otherwise the Swedish variable name will be recycled.
A folder path/apps/sv|en/folder containing: global.R, server.R, ui.R, data/data.RData, docs/description.html.
Fredrik Sandin, RCC Uppsala-Örebro
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ind1 <- rccShiny(
data = rccShinyData,
folder = "Indikator1",
folderLinkText = "Indikator 1",
outcome = paste0("outcome",1:3),
outcomeTitle = c("Dikotom", "Kontinuerlig", "Kategorisk"),
comment = "Skovde och Lidkoping tillhor Skaraborg",
description = c("Har beskrivs indikatorn.","Viktig information!","Information om variabler etc."),
varOther = list(
list(
var = "age",
label = "Alder vid diagnos"
),
list(
var = "stage",
label = "Stadium",
choices = c("I", "II"),
selected = "I",
multiple = TRUE,
showInTitle = TRUE
)
),
funnelplot = TRUE
)
## Not run:
library(shiny)
runApp("./apps/sv/Indikator1")
cat(ind1) # displays the html link that can be used in index.html
## End(Not run)
# For Swedish/English version
rccShinyData$outcome1_en <- rccShinyData$outcome1
rccShiny(
language = c("sv", "en"),
data = rccShinyData,
folder = "Indikator2",
outcome = "outcome1",
outcomeTitle = list("Kontaktsjukskoterska", "Contact nurse"),
textBeforeSubtitle = c("Nagot pa svenska","Something in English"),
description = list(
c("Har beskrivs indikatorn.","Viktig information!","Information om variabler etc."),
c("Description of the indicator","Important information!","Information on variables etc.")
),
varOther = list(
list(
var = "age",
label = c("Alder vid diagnos","Age at diagnosis"),
choices = c(0,120)
)
),
targetValues = c(95,99)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.