Description Usage Arguments Value Author(s) Examples
This function can check the monoticity of a single vector, matrix, or data.frame that has multiple IDs within the matrix or data.frame.
1  | 
data | 
 a data.frame or matrix or vector of measurement data  | 
id.col | 
 column where the id's are stored; default is NULL  | 
y.col | 
 column where y values, or measurements are stored; default is NULL  | 
direction | 
 the direction of the function a choice between increasing 'inc', and decreasing 'dec'  | 
If the user enters a vector, the function returns TRUE or FALSE as to where that particular vector is monotonic increasing or not, it returns NA if the vector has missing values. If the user enters a matrix or data frame, the function returns a matrix with 2 columns. The first column as the id. The second column as a 0 for FALSE and 1 for TRUE as to where the data in that particular id is monotonic increasing or not, or NA if the y column has missing values in that particular id.
Michele Josey mjosey@nccu.edu Melyssa Minto mminto@nccu.edu
1 2 3 4 5 6 7 8 9 10  | data(simulated_data)
## Run monotonic
test <- monotonic(simulated_data, 1,3, direction='inc')
## look at the number of ids that are non-monotonic
table(as.logical(test[,2]))
##to ignore NA values
x<-c(1,2,3,5,NA,7,8)
monotonic(na.omit(x), direction='inc')
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.