Description Usage Arguments Details Value Author(s) Examples
This function generates a grid density object which can then be used to produced a heatmap or contourplots. In cells with a count > 0 and < 5 are considered invalid and the count is set to 0. The function prints the number of invalid cells in for participating study.
1 2 | ds.densityGrid(x = NULL, y = NULL, numints = 20, type = "combine",
datasources = NULL)
|
x |
a character the name of numerical vector |
y |
a character the name of numerical vector |
numints |
an integer, the number of intervals for the grid density object, by default is 20. |
type |
a character which represent the type of graph
to display. If |
datasources |
a list of opal object(s) obtained
after login in to opal servers; these objects hold also
the data assign to R, as |
In DataSHIELD the user does not have access to the
micro-data so and extreme values such as the maximum and
the minimum are potentially disclosive so this function
does not allow for the user to set the limits of the
density grid and the minimum and maximum values of the x
and y vectors. These elements are set by the server side
function densitygrid.ds
to 'valid' values (i.e.
values that do not lead to leakage of micro-data to the
user).
a grid density matrix is returned
Isaeva, J.; Gaye, A.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | {
# load the file that contains the login details
data(logindata)
# login and assign the required variables to R
myvar <- list("LAB_TSC","LAB_HDL")
opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)
# Example1: generate a combined grid density object (the default behaviour)
ds.densityGrid(x='D$LAB_TSC', y='D$LAB_HDL')
# Example2: generate a grid density object for each study separately
ds.densityGrid(x='D$LAB_TSC', y='D$LAB_HDL', type="split")
# Example3: generate a grid density object where the number of intervals is set to 15, for each study separately
ds.densityGrid(x='D$LAB_TSC', y='D$LAB_HDL', type="split", numints=15)
# clear the Datashield R sessions and logout
datashield.logout(opals)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.