R/SwapOrder.R

Defines functions `SwapOrder`

`SwapOrder` <-
function(data) {
	d <- data
	if (inherits(d, "mlds.df")) {
		invord <- attr(data, "invord")
		} else
	{
	invord <- (data$S1 > data$S4) }
	d$resp[invord] <- 1 - data$resp[invord]
	d[invord, -1] <- d[invord, c(4, 5, 2, 3)]
	d	
}

Try the MLDS package in your browser

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

MLDS documentation built on Aug. 20, 2023, 9:06 a.m.