#' InflectionPoint
#'
#' @param data add description
#' @param timeOrCountVariable add description
#' @param nestingTimeUnit add description
#' @return df dataframe
#' @export
#'
closestToZero <- function(data, timeOrCountVariable, nestingTimeUnit) {
df <- data
df$time <- y # 'z' arg (specific count variable e.g. countReject) now generic variable
df$time <- as.numeric(df$time)
df$nestingUnit <- z
timeCol <- match('time', names(df))
nestingUnitCol <- match('nestingUnit', names(df))
for (i in 1:dim(df)[1]) {
for (j in 1:dim(df)[2]) {
if (j == timeCol) {
if (is.na(df[i, timeCol])) {
df[i, j] <- -999
} else {
if (i != 1) {
if (df[i, timeCol] >= 0) {
if (df[(i - 1), timeCol] < 0) {
df[i, timeCol] <- 0
}
}
}
}
}
}
}
ifelse(df$time == -999, NA, df$time)
df
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.