Description Usage Arguments Bugs Examples
This function will take 4 columns of data, format the data, then feed it to parsetR where it will be converted into a D3 plot.
1 2 | parallelsets(dataframe, id, linename, linenumber, n_common = 5,
return_data = F, ...)
|
dataframe |
the dataframe holding the data |
id |
grouping variable that links the long data. Most likely patient id. |
linename |
The name of the line - or whatever goes in the bars |
linenumber |
A column with the numeric line number. |
n_common |
The n most common treatments you want to include. Others will go into no treatment or other. |
return_data |
FALSE by default. If true, it will return the formatted data for you to pass to the plotting function yourself. |
... |
passdown options |
If you find an issue, post it here and we'll try and fix it: http://go.roche.com/RochePlotissue
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 | ## Not run:
##### Get data from flatiron ##################
library(dplyr)
# data valid today
valid_date <- Sys.Date()
# If on Windows, life is no fun
if (Sys.info()[["sysname"]] == "Windows"){
Sys.setenv(JAVA_HOME="") # for java - go to 64bit
}
# connect to data
tdRWDSconnect(
datalab = FALSE,
type = "teradataR"
)
line.of.therapy <- tdQuery(paste0(
"
SELECT
patientid
,LineName
,LineNumber
,IsMaintenanceTherapy
FROM rwd_vdm_flatiron.v_cll_lineoftherapy
WHERE
VALID_START <= CAST('",paste0(valid_date," 00:00:00"),"' AS TIMESTAMP) AND
VALID_END >= CAST('",paste0(valid_date," 00:00:00"),"' AS TIMESTAMP)
;"
)) %>%
filter(
# just do lines 1 to 3
LineNumber < 4 & LineNumber > 0 &
# and ignore maintenence
IsMaintenanceTherapy == "False"
)
##### Use function ##################
RWDSparallelsets(
dataframe = line.of.therapy,
id = "PatientID",
linename = "LineName",
linenumber = "LineNumber",
n_common = 3
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.