I now have a geneorama package available. It’s not on CRAN, because it’s not even remotely documented. I do hope to do that at some point, but not today.
You can install it by simply opening up this file!
Be warned: Opening this file will modify your rprofile.site file (located in R\Rversion\etc).
The script will add the text “library(geneorama)” to end of the profile file, if it doesn’t already exist, which will automatically load the geneorama package when you start R.
EDIT (2018): Do not install this way (I have removed the file so that you can’t download it). Use `devtools::install_github(“geneorama/geneorama”)` instead.
The installation works on both a PC and a mac. The automatic installation uses the .First function to simply copy the library files to your R Program file location.
The package contains my functions. Some of these are:
Use loader to load that a single object from an RData file (you must have saved only one object in the RData file)
myNumbers = rnorm(100) save(myNumbers, file='temp.RData') anybodysNumbers = loader(myNumbers)
Save one object to an RData environment, in a folder called “Output” (deprecated)
This is a glorified version of ls, (based on ll from gdata). It will tell you the size and type of your current objects, and it filters out functions. Useful for tracking large variables, but less useful not that we have RStudio.
Make a matrix of geometric brownian or regular brownian motion simulations. You can see an example of the functions usage in the comments of the actual function. Just type makegm and look at the bottom of the function’s code to see the pricing of a simple put option.
Add a background to a plot area.
## Make a plot, and then add a semitransparent yellow background to the plot: plot(rnorm(100)) addbg() ## Make a plot with a background: plot(rnorm(100), panel.first=bgfun())
Write a data frame to a temporary CSV file and open it in your registered CSV application. (depends on pbs modelling package). Stands for “write temp”. (Originally it was wt, but then I made a better version, and wtt was born)
Write to and from the clipboard.
## Run this command, then paste 100 random normal numbers into excel or text file clipper(rnorm(100)) ## make something in excel, copy it to the clipboard, and then run this line: x = clipped()
There are other functions, but these are the most useful. they are just some simple utilities that I use on a daily basis.
Pingback: Bias Variance Tradeoff » Geneorama
By the way, if you want to know what’s inside the file, download it and open it by dragging it into a running instance of R (or load it manually). Then view the .First function by just typing .First.