reconcileSubjectVisits: Function for doing something/something comparisons

Description Usage Arguments Value Examples

View source: R/reconcileSubjectVisits.R

Description

This function helps you see which subject/visit combinations are missing either in the site data or in the biorepository data.

Usage

1
2
3
reconcileSubjectVisits(report.type = c("data.no.samples", "samples.no.data"),
  repository.data, site.data, repo.subject.column, repo.visit.column,
  site.subject.column, site.visit.column)

Arguments

report.type

Which records to return

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

site.subject.column

Column name of subject IDs in site data.frame

site.visit.column

Column name of visit in repository data.frame

Value

A data.frame with the appropriate column headings. If the report.type is "data.no.samples", then the column headings are from the site data.frame. If the report.type is "samples.no.data", then the column headings are from the repository data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
repository <- data.frame(subject = c(LETTERS[1:5], LETTERS[1:5]), visit = c(1:5, 1:5),
                         specimen = c(rep("blood", 5), rep("DNA", 5)),
                         stringsAsFactors = FALSE)

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

# Check to see if there is data from the site but no samples at the biorepository
reconcileSubjectVisits(report.type = "data.no.samples", repository.data = repository,
                       site.data = site, repo.subject.column = "subject",
                       repo.visit.column = "visit", site.subject.column = "patno",
                       site.visit.column = "clinevent")

# Check to see if there are samples at the biorepository but no data from the site
reconcileSubjectVisits(report.type = "data.no.samples", repository.data = repository,
                       site.data = site, repo.subject.column = "subject",
                       repo.visit.column = "visit", site.subject.column = "patno",
                       site.visit.column = "clinevent")

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