Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titlePrerequisites

It is recommended that you familiarise yourself with R first by sitting our Introduction to R tutorial.

It also requires that you have the DataSHIELD training environment installed on your machine, see our Installation Instructions for Linux, Windows, or Mac.


Tip
titleHelp

DataSHIELD support is freely available in the DataSHIELD forum by the DataSHIELD community. Please use this as the first port of call for any problems you may be having, it is monitored closely for new threads.

DataSHIELD bespoke user support and also user training classes are offered on a fee-paying basis. Please enquire at datashield@newcastle.ac.uk for current prices. 

...

  • the data frame we are working with throughout this tutorial ("D"), as the df.name argument
  • the column we wish to split by class ("D$GENDERDST$GENDER"), as the V1.name argument
  • the value we want to compare the column with, in this case a number ("0"), as the V2.name argument
  • the boolean operator we want to use to compare V2.name with V1.name argument
  • the specific name we want to call the new object, in string form, with the newobj argument
  • as always, specify the datasources = connections
Code Block
languagexml
ds.dataFrameSubset(df.name = "DST", V1.name = "D$GENDERDST$GENDER", V2.name = "1", Boolean.operator = "==", newobj = "CNSIM.subset.Males", datasources= connections)
ds.dataFrameSubset(df.name = "DST", V1.name = "D$GENDERDST$GENDER", V2.name = "0", Boolean.operator = "==", newobj = "CNSIM.subset.Females",datasources= connections)

...

Code Block
languagexml
themeRDark
  Aggregated (dataFrameSubsetDS1("DST", "D$PMDST$PM_BMI_CONTINUOUS", "25", 6, NULL, ) [==========] 100% / 1s
  Assigned expr. (subset.BMI.25.plus <- dataFrameSubsetDS2("DST", "D$PMDST$PM_BMI_CONTINUOUS", "25", 6, N...
  Aggregated (testObjExistsDS("subset.BMI.25.plus")) [===================================] 100% / 0s
  Aggregated (messageDS("subset.BMI.25.plus")) [=========================================] 100% / 0s
$is.object.created
[1] "A data object <subset.BMI.25.plus> has been created in all specified data sources"

$validity.check
[1] "<subset.BMI.25.plus> appears valid in all sources"

The subset of data retains the same variables names i.e. column names. Note we are addressing our newly-named object on the serverside, not accessing a column of the original dataframe "D$DST$...." as before:

Code Block
languagexml
ds.colnames(x="subset.BMI.25.plus", datasources = connections)

...