Skip to contents

Format censored data

Usage

formMWRcens(censdat)

Arguments

censdat

input data frame

Value

A formatted data frame of the censored data

Details

This function is used internally within readMWRcens to format the input data for downstream analysis. The formatting includes:

  • Convert Parameter: All parameters are converted to Simple Parameter in paramsMWR as needed,

  • Convert Missed and Censored Records: All values are converted to numeric

Examples

library(dplyr)

censpth <- system.file('extdata/ExampleCensored.xlsx', 
     package = 'MassWateR')

censdat <- suppressMessages(readxl::read_excel(censpth, 
      na = c('NA', 'na', '')
    )) 
    
formMWRcens(censdat)
#> # A tibble: 3 × 2
#>   Parameter `Missed and Censored Records`
#>   <chr>                             <int>
#> 1 pH                                   12
#> 2 DO                                    1
#> 3 Nitrate                               0