my.text <- c(A = "This is the first string",
B = "This is the second string, which is longer")
wrap_labels(my.text, width = 20)
wrap_labels(unname(my.text), width = 20)
cat(wrap_labels(my.text, width = 20), sep = "\n--\n")
cat(wrap_labels(my.text, width = 20, indent = 2), sep = "\n--\n")
cat(wrap_labels(my.text, width = 20, indent = -2), sep = "\n--\n")
Run the code above in your browser using DataLab