Addition of covariate information

Function adds information about numerical columns in IQRdataGENERAL to be used as covariates into attributes. Continuous and categorical covariates are differentiated whether entries in VALUES are NA or VALUES column exists.

addCovariateInfo_IQRdataGENERAL(
  x,
  newCovariates,
  opt_overwrite = c("stop", "overwrite", "keep_previous")
)

Arguments

x

IQRdataGENERAL object

newCovariates

Data frame with covariate information in the style of covInfoAdd or catInfoAdd

opt_overwrite

One of c("stop", "overwrite", "keep_previous")

Value

IQRdataGENERAL object with updated covInfo or catInfo

See also

Other IQRdataGeneral: +.IQRdataGENERAL(), IQRcalcTAD(), IQRdataGENERAL(), IQRexpandADDLII(), IQRloadCSVdata(), IQRsaveCSVdata(), addIndivRegressors_IQRdataGENERAL(), addLabel_IQRdataGENERAL(), attributes0(), blloqInfo_IQRdataGENERAL(), blloq_IQRdataGENERAL(), check_IQRdataGENERAL(), clean_IQRdataGENERAL(), combine_IQRdataGENERAL(), convertCat2Text(), covImpute_IQRdataGENERAL(), date2dateday_IQRdataProgramming(), date2datetime_IQRdataProgramming(), date2time_IQRdataProgramming(), exportDEFINE_IQRaedataER(), exportDEFINE_IQRdataGENERAL(), exportDEFINEpdf_IQRdataGENERAL(), exportSYS_IQRdataGENERAL(), export_IQRdataGENERAL(), getLabels_dataframe(), getNAcolNLME_IQRdataGENERAL(), handleSameTimeObs_IQRdataGENERAL(), is_IQRdataGENERAL(), loadATRinfo_csvData(), loadAttributeFile(), load_IQRdataGENERAL(), mapCategoricalCovariate_IQRnlmeProject(), mapCategoricalCovariate_csvData(), mapContinuousCovariate_IQRnlmeProject(), mapContinuousCovariate_csvData(), mutateCov_IQRdataGENERAL(), obfuscate_IQRdataGENERAL(), plot.IQRdataGENERAL(), plotCorCat_IQRdataGENERAL(), plotCorCovCat_IQRdataGENERAL(), plotCorCov_IQRdataGENERAL(), plotCovDistribution_IQRdataGENERAL(), plotDoseSchedule_IQRdataGENERAL(), plotIndiv_IQRdataGENERAL(), plotObsSummarizedByCovCat_IQRdataGENERAL(), plotRange_IQRdataGENERAL(), plotSampleSchedule_IQRdataGENERAL(), plotSpaghetti_IQRdataGENERAL(), print.IQRdataGENERAL(), removeCommata_dataframe(), rmAMT0_IQRdataGENERAL(), rmDosePostLastObs_IQRdataGENERAL(), rmIGNOREd_IQRdataGENERAL(), rmMissingTIMEobsRecords_IQRdataGENERAL(), rmNOobsSUB_IQRdataGENERAL(), rmNonTask_IQRdataGENERAL(), rmPLACEBO_IQRdataGENERAL(), rmSubjects_IQRdataGENERAL(), setIGNORErecords_IQRdataGENERAL(), setMissingDVobsRecordsIGNORE_IQRdataGENERAL(), subset.IQRdataGENERAL(), summary.IQRdataGENERAL(), summaryCat_IQRdataGENERAL(), summaryCov_IQRdataGENERAL(), summaryObservations_IQRdataGENERAL(), transformObs_IQRdataGENERAL(), unlabel_dataframe()

Examples

if (FALSE) { # \dontrun{
library(IQRtools)
x <- load_IQRdataGENERAL(system.file("docs/material/01-01-DataProgAnal/dataGeneral02.dat.zip", package = "IQRtools"))
x$SEXF <- 0
x$WTKG <- x$BMI0 * 170^2
newCovariates <- tibble::tribble(
  ~COLNAME  , ~NAME        , ~VALUES, ~VALUETXT    , ~UNIT, ~TIME.VARYING,
  "SEXF"    , "is female"  , "0,1"  , "male,female", "-"  , FALSE        ,
  "WTKG"    , "Body weight", NA     , NA           ,  "kg", FALSE
)
newCovariates2 <- tibble::tribble(
  ~COLNAME  , ~NAME        , ~VALUES, ~VALUETXT    , ~UNIT, ~TIME.VARYING,
  "WTKG"    , "Weight", NA     , NA           ,  "tons", FALSE
)

x <- addCovariateInfo_IQRdataGENERAL(x, newCovariates)
addCovariateInfo_IQRdataGENERAL(x, newCovariates2) # expect errror
covInfo(addCovariateInfo_IQRdataGENERAL(x, newCovariates2, opt_overwrite = "overwrite"))
covInfo(addCovariateInfo_IQRdataGENERAL(x, newCovariates2, opt_overwrite = "keep_previous"))
} # }