Posts Tagged ‘R’
The vim-template plugin allows for the use of templates for different file types: *.html, *.py and so on. Following the installation instructions (see above link), we use pathogen to install the plugin:
cd ~/.vim/bundle git clone git://github.com/aperezdc/vim-template.git
Use of plugin
Now, you can make use of the templates when starting vim. For example, a python template is loaded by recognition of the *.py filename:
Or, if you have new buffer, type the following for the template to be loaded inside vim:
The available templates can be seen here. Using the pathogen installation described above, these templates are located (on your machine) at
If you want to customize certain fields, like email and username, you can add the following to your .vimrc file:
" Customize the settings for vim-template plugin let g:email = "email@example.com" let g:user = "Desired Name" let g:license = "Desired License"
If you want to customize the templates, there is a search order for templates (see here) allowing you to write your own template-files and store them in the local directory.
pomp (partially-observed Markov processes) is a package in R for simulating stochastic and deterministic mathematical models as well as to infer parameters using observed data — also see the r-forge page. I will provide (very) brief install instructions here and provide examples of use in later posts.
Install by going to the command line and starting R using sudo (I assume you are using Ubuntu here):
Once in R, type:
install.packages('pomp', dep = TRUE)
The pomp package and other packages it requires will be downoaded, compiled, and installed. You can test that pomp is available by loading the package in an R session:
I install R using the instructions at cran.r-project.org (direct link to instructions). At the website, click ‘Download R for Linux’ then ‘ubuntu’ to get the most up-to-date instructions. Following these instructions, my process was as follows:
Add the repository, using the CRAN server of your choice (I use UCLA here) and the appropriate Ubuntu version (I use precise for Ubuntu 12.04):
sudo add-apt-repository "deb http://cran.stat.ucla.edu/bin/linux/ubuntu precise/"
For security, get the key and add it to your keyring (NOTE: the CRAN website says that some people are having issues with this step — if the commands here do not work for you, check there for latest information):
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 gpg -a --export E084DAB9 | sudo apt-key add -
Next, update and install (the documentation says you might want to install r-base-dev as well, but I found this package is already included using the commands below):
sudo apt-get update sudo apt-get install r-base
To install package not in the base set, use the following commands
Now, inside R, install package packagename with
install.packages('packagename', dep = TRUE)
Note — the quotes around the packagename ARE needed.
Again, start R with sudo:
Now, inside R, update packages with
update.packages(ask = FALSE)
- Download the debian package from http://www.rstudio.org
- I downloaded RStudio 0.97.237 – Debian 6+/Ubuntu 10.04+ (64-bit) — this is actually a file: rstudio-0.97.237-amd64.deb
- If all dependencies are installed (output will complain if not), install rstudio-0.97.237-amd64.deb file using
sudo dpkg -i rstudio-0.97.237-amd64.deb
I got a complaint about libjpeg62 and installed is using:
sudo apt-get install libjpeg62
followed by the installation of the deb file, as shown above.