R/nerve/ExploratoryAnalysis.R

# Title     : ExploratoryAnalysis.R
# Objective : Exploratory analysis
# Created by: greyhypotheses
# Created on: 07/04/2022


#' Explore
#'
#' @param nerve: The data frame of the nerve data set
#'
ExploratoryAnalysis <- function (nerve){

  # inspect ranges via summary(.)
  summary(nerve)

  # there are 10 distinct locations, each associated with 96 records
  unique(nerve$location)
  table(nerve$location, useNA = 'always')

  # each location has 6 distinct patients
  nerve %>%
    dplyr::select(location, patient) %>%
    unique() %>%
    dplyr::group_by(location) %>%
    summarise(N = n(), .groups = 'keep')

  # hence 6 * 10 distinct patients expected
  length(unique(nerve$patient))

  # there are 16 distinct records per patient
  table(nerve$patient, useNA = 'always')

}
premodelling/mixed documentation built on April 25, 2022, 6:27 a.m.