### load a package
safeRequire('ggplot2');
### trim a string
trim(' this is a string with whitespace in front and at the end ');
### Returns "this is a string with whitespace in front and at the end"
repeatStr("-", 8);
### Returns "--------" (incredibly useful, no? :-))
tempVector <- c(1,2,3,3,2,4,3,2,1,1,3,4,5,4,3,2,2,1,1,2);
invertedTempVector <- invertItem(tempVector);
### We can also invert it back, but then we have to override the security
### that prevents accidently inverting items back.
invertItem(tempVector, ignorePreviousInversion=TRUE);
Run the code above in your browser using DataLab