reconcileVisits: Checks if there are any visit data missing from site or...

Description Usage Arguments Value Examples

View source: R/reconcileVisits.R

Description

This function looks at a subject/visit and helps you see if specimen data are missing from the site or from the biorepository.

Usage

1
2
3
reconcileVisits(repository.data, site.data, repo.subject.column,
  repo.visit.column, repo.specimen.column, site.subject.column,
  site.visit.column, site.specimen.column, simplify = FALSE)

Arguments

repository.data

data.frame of repository data with columns that will provide unique rows of interest

site.data

data.frame of site data with columns that will provide unique rows of interest

repo.subject.column

Column name of subject IDs in repository data.frame

repo.visit.column

Column name of visit in repository data.frame

repo.specimen.column

Column name of specimen in repository data.frame

site.subject.column

Column name of subject IDs in site data.frame

site.visit.column

Column name of visit in repository data.frame

site.specimen.column

Column name of specimen in site data.frame

simplify

Simplify the output

Value

A data.frame with columns subject, visit, repository_specimen, and site_specimen. An NA indicates that the corresponding specimen type was not found. For example, if a subject/visit contains "DNA" in the repository_specimen column and NA in the site_specimen column, then the site data is missing a DNA sample for that subject/visit. (This does not give any information about the number of samples for each specimen–only whether or not at least a single specimen for each subject/visit is present in either data set.)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
repository <- data.frame(subject = c(LETTERS[1:5], LETTERS[1:6]), visit = c(1:5, 1:6),
                         specimen = c(rep("blood", 5), rep("DNA", 5), "serum"),
                         stringsAsFactors = FALSE)

site <- data.frame(patno = c(LETTERS[2:6], LETTERS[2:6], "F"), clinevent = c(2:6, 2:6, 6),
                   sample = c("RNA", rep("blood", 4), "serum", rep("DNA",  4), "serum"),
                   stringsAsFactors = FALSE)

reconcileVisits(repository.data = repository, site.data = site, repo.subject.column = "subject",
                repo.visit.column = "visit", repo.specimen.column = "specimen", site.subject.column = "patno",
                site.visit.column = "clinevent", site.specimen.column = "sample")

NateByers/Reconcile documentation built on Nov. 21, 2021, 4:12 p.m.