### The default variable view
rosetta::varView(iris);
### Only for a few variables in the dataset
rosetta::varView(iris, columns=c("Sepal.Length", "Species"));
### Set some variable and value labels using the `labelled`
### standard, which is also used by `haven`
dat <- iris;
attr(dat$Sepal.Length, "label") <- "Sepal length";
attr(dat$Sepal.Length, "labels") <-
  c('one' = 1,
    'two' = 2,
    'three' = 3);
### varView automatically recognizes and shows these, adding
### a 'label' column
rosetta::varView(dat);
### You can also specify that you only want to see some columns
### in the variable view
rosetta::varView(dat,
                 varViewCols = c('label', 'values', 'level'));
Run the code above in your browser using DataLab