[R] Compressing a sequence

Dennis Fisher ||@her @end|ng |rom p|e@@th@n@com
Sat Feb 22 01:46:25 CET 2025


R 4.4.0
OS X

Colleagues

I have a sequence like:
	1, 3, 4, 5, 7, 8, 12, 13, 14, 15, 20

I would like to display it as:
	1, 3-5, 7-8, 12-15, 20

Any simple ways to accomplish this?

Dennis


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com


	[[alternative HTML version deleted]]



More information about the R-help mailing list