Blog Archives

Use IUCN API with R & XPath

June 28, 2012
By
Use IUCN API with R & XPath

Thanks to a posting on R-sig-eco mailing list I learned of the IUCN-API. Here's a simple example for what can be done with it (output as pdf is HERE):require(XML)require(maptools)require(jpeg)input = "panthera-uncia"h <- htmlParse(paste("http://api....

Read more »

Avoid Overplotting of Text in Ordination Diagram

June 25, 2012
By
Avoid Overplotting of Text in Ordination Diagram

Referring to a recent posting on r-sig-eco mailing list I'll add this example to theBioBucket:library(vegan)library(vegan)data(dune)sol <- metaMDS(dune) # use ordipointlabel -# here is an example where I added cex according to species frequencies:pl...

Read more »

A Wrapper Function for Instant Package Installation / Loading

June 19, 2012
By

Since library() and require() only accept input with length(input) = 1 it is necessary to make repeated calls - this can be quite annoying.. So, HERE is a little wrapper function for convenient package installation / loading. It installs packages if th...

Read more »

FloraWeb Plant Species Report via R

June 10, 2012
By
FloraWeb Plant Species Report via R

For German-spoken users I added the function floraweb_scrape.R that allows you to conveniently collect species data and print to a PDF-file (see this example output). The function accesses data provided by the  web-site FloraWeb.de (BfN - Bundesministerium für Naturschutz).You can use it as an interactive version (RTclTk) which I have put to a Github repository

Read more »

Source R-Script from Dropbox

May 14, 2012
By
Source R-Script from Dropbox

A quick tip on how to source R-scripts from a Dropbox-account:(1) Upload the script.. (2) Get link with the "get link" option. The link should look like "https://www.dropbox.com/s/XXXXXX/yourscript.R"..(3) Grab this part "XXXXXX/yourscript.R" and paste...

Read more »

knitr-Example: Use World Bank Data to Generate Report for Threatened Bird Species

May 2, 2012
By
knitr-Example: Use World Bank Data to Generate Report for Threatened Bird Species

I'll use the below script that retrieves data for threatened bird species from the World Bank via its API and does some processing, plotting and analysis. There is a package (WDI) that allows you to access the data easily.# world bank indicators for sp...

Read more »

Playing with knitr: Create Report with Dynamic List

May 1, 2012
By
Playing with knitr: Create Report with Dynamic List

Here is a little toy example using knitr, LaTeX/MiKTeX and Google Docs.Say you had a list on Google Docs (say a list of attendants) and you want to print a report with it..Then see this example using this Rnw-file and the output...make the tex-file wit...

Read more »

Quick Tip: Replace Values in Dataframe on Condition with Random Numbers

May 1, 2012
By

This one took me some time - though, in fact it is plain simple:> options(scipen=999)> (my_df X1 X2 X3 X4 X5 X6 X7 X8 X9 X101 0 0 1 0 1 1 1 1 0 12 0 0 1 ...

Read more »

Reproducible Research: Running odfWeave with 7-zip

April 25, 2012
By

odfWeave is an R-package that is used for making dynamic reports by Sweave processing of Open Document Format (ODF) files. For anyone new to report generation and lacking knowledge of markup languages this might be a good starting point or even a true ...

Read more »

Reproducible Research: Export Regression Table to MS Word

April 20, 2012
By
Reproducible Research: Export Regression Table to MS Word

Here's a quick tip for anyone wishing to export results, say a regression table, from R to MS Word:require(R2wd)# install packages required# install software RCOM, RDCOMClient # (I had to restart the R-Session after the above step to get it work)wdGet(...

Read more »