View source: R/find_next_good_datapoint.R
find_next_good_datapoint | R Documentation |
What Is the Next Non-Null Data Point?
find_next_good_datapoint(data_row, index, n_replicates)
data_row |
A numeric vector representing the data row. |
index |
The index of the current data point. |
n_replicates |
The total number of replicates (length of the row) |
Given a data row, an index, and the number of replicates (the number of elements in the row), this function finds the next good data point in the row.
A good data point is a non-missing value (not NA) with a non-empty string.
The next good data point or -999 if none is found.
data_row <- c(NA, 3, 2, NA, 5)
index <- 1
n_replicates <- 5
find_next_good_datapoint(data_row, index, n_replicates) # expect 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.