R/leave1out.R

Defines functions leave1out

Documented in leave1out

#' leave1out
#'
#' @param x Which row(s) of data to leave out
#' @param data A dataframe or matrix.
#'
#' @return The reduced dataframe or matrix
#' @export
#'
#' @examples data<-cbind(1:10,1:10)
#' leave1out(5,data)
#' 
leave1out<-function(x,data){
  data<-data[-x,]
  return(data)
}

Try the Omisc package in your browser

Any scripts or data that you put into this service are public.

Omisc documentation built on Aug. 9, 2022, 5:09 p.m.