as_CheckData
as_checkData.Rd
Data checks and summaries: duplicate records, negative analytic values, numbers of analytic results, percentiles of results
Usage
as_checkData(
doc = "as_CheckData",
data,
CheckDupVars,
GroupVar = " ",
Groups,
ID = " ",
AnalyticVars,
folder = " "
)
Arguments
- doc
a character string written to the output list; default is the function name
- data
R object (data frame) containing analytic data
- CheckDupVars
vector with names of identifying variables, typically group and lab ID
- GroupVar
if there are groups, name of variable defining the groups, default value of " ": no grouping
- Groups
character vector of groups by which numbers of samples and statistics statistics will be tabulated default value of " ": tabulations are done for the entire data set value = "All": tabulation for each distinct code in GroupVar
- ID
name of lab ID, default is " " (no lab ID)
- AnalyticVars
character vector of names of analytic variables for which tabulations are done
- folder
the path to a folder in which data frames will be saved; default is " " #``
Value
Four data frames with duplicate observations, observations with negative values for one or more analytic variables, numbers of observations for each analytic variable, and statistics statistics (quartiles and number missing) if Groups != " ", numbers of observations and statistics statistics are by group A list with the following components:
usage: A string with the contents of the argument doc, date run, R version used
dataUsed: The data frame specified by the argument data and GroupVar|
params: A character vector with the values of CheckDupVars, GroupVar, and Groups
analyticVars: The vector of names specified by the argument AnalyticVars
Duplicates: A data frame containing the observations with duplicate values
NegativeValues: A data frame containing the observations with at least one negative value for a variable in AnalyticVars
Nvalues: A data frame contain the number of observations with a value for each analytic variable
statistics: A data frame containing the statistics statistics (by group, if Group is specified)
location: If folder != " ", the path to the folder in which data frames will be saved