find_comments: Find commented records

View source: R/lastdose.R

find_commentsR Documentation

Find commented records

Description

This function uses specific criteria for finding comment records that may not match up with your coding conventions. See details below as well as unit tests.

Usage

find_comments(x, ...)

## S3 method for class 'data.frame'
find_comments(x, ...)

## S3 method for class 'character'
find_comments(x, ...)

## S3 method for class 'logical'
find_comments(x, ...)

Arguments

x

a data frame or character vector

...

not used

Details

For the data frame method, comments are found in a column with name C with type character. If a C column is found that is not character, a warning is generated and no comments are found.

For the character method or when an appropriate C column is found when using the data frame method, a position or row is considered a comment when it is either NA or when it is equal to ..

Value

A logical vector

Examples

comment <- c(NA, "C", "C", NA, ".", NA, "Comment")
dv <- rnorm(length(comment))
df <- data.frame(C = comment , DV = dv, stringsAsFactors = FALSE)

find_comments(df)



metrumresearchgroup/lastdose documentation built on April 12, 2025, 3:51 p.m.