2015年10月27日 星期二

10.27 Week 4 Getting and Cleaning Data Note

Here's some useful functions learned from the video lectures:
tolower(): change character to lower case
sub(): subtitute out certain characters
grep(), grepl() (return logical value)
stringr package: nchar(), substr(), str_trim() (remove extra space)

Principles: name of variables should avoid dots; variables with character values should be made into factor and be descriptive.

Metacharacter:
^ beginning of a line
$ end of a line
[] upper/lower case (e.g. [Bb]
[-] a range of letters and numbers (regardless of order)
^ in [] will indicate NOT in the indicated class.

2015年10月23日 星期五

10.23 xlcFreeMemory from XLConnect package

Wow. Has been a while since the last post. But is doing super busy these days. Lots of data analysis.

Just found a package that is useful in the future for using R to handle big excel dataset: XLConnect.

original post: http://stackoverflow.com/questions/12476044/r-how-to-clear-memory-used-by-rjava

need both XLConnectJars and XLConnect packages to run the function xlcFreeMemory(), which clear the memory used by rJava.