if (FALSE) {
library(jmvReadWrite)
fleOMV <- system.file("extdata", "AlbumSales.omv", package = "jmvReadWrite")
fleTmp <- paste0(tempfile(), ".omv")
# the original file has the variables in the order: "Adverts", "Airplay", "Image", "Sales"
names(read_omv(fleInp = fleOMV))
# first, we move the variable "Sales" to the first place using the varOrd-parameter
arrange_cols_omv(fleInp = fleOMV, fleOut = fleTmp,
varOrd = c("Sales", "Adverts", "Airplay", "Image"))
names(read_omv(fleInp = fleTmp))
# now, we move the variable "Sales" to the first place using the varMve-parameter
arrange_cols_omv(fleInp = fleOMV, fleOut = fleTmp, varMve = list(Sales = -3))
names(read_omv(fleInp = fleTmp))
unlink(fleTmp)
}
Run the code above in your browser using DataLab