dataRead {nemtr}R Documentation

Read and Validate Dataframe

Description

Read in data and validate before analysis is conducted

Usage

dataRead(
  dataFrame,
  timing,
  streams,
  VoI = NA,
  type = "long",
  median0 = NA,
  delta = 3
)

Arguments

dataFrame

A user inputted dataframe, can be wide or long

timing

A string of the timing variable name

streams

A string of the streams variable name

VoI

A string of the Variable of Interest name

type

A string of the type of data (default long)

median0

A value for expected median

delta

A value for delta (default 3)

Value

A validated dataframe in long format

Examples

set.seed(795014178)
streams <- 20
time <- 60
samples <- 15
mu0 <- 3
delta <- 3
library(dplyr)
turnstiles <- tibble(
  turnstile = rep(rep(1:streams,each=samples),time),
  hour = rep(1:time,each=streams * samples),
  sample = rep(rep(1:samples), times = streams * time),
  waitTime = rexp(streams * time * samples,rate=.22985)
  ) %>% mutate(waitTime = if_else(hour == 38, waitTime * 2,waitTime))
dataRead(turnstiles, timing="hour", streams="sample", VoI="waitTime", type="long", median0 = 3)


[Package nemtr version 0.0.1.0 Index]