I'm new to R and am trying to create custom values in the 'Stats / Values' column in R. I use the dfSummary function as follows:
dfSummary(as.data.frame(y), headings = FALSE, varnumbers = FALSE, labels.col = TRUE, max.distinct.values = 25))}
Example output I get in the 'Stats / Values' column is 1. Male, 2. Female.
How can I customise this column? I have a list called index and text. e.g. index = [0,1], text = ['Male','Female']. Based on this data I would like the 'Stats / Values' column to be 0. Male, 1. Female.
A second example: index = [0,1,9], text = ['Car','Truck', 'Plane']. 'Stats / Values' column should be 0. Car, 1. Truck, 9. Plane.
What is a simple way to do this?