Blog Archives

Testing the Effect of a Factor within each Level of another Factor with R-Package {contrast}

February 27, 2012
By
Testing the Effect of a Factor within each Level of another Factor with R-Package {contrast}

This is a small example of how custom contrasts can easily be applied with the contrast-package. The package-manual has several useful explanations and the below example was actually grabbed from there.This example can also be applied to a GLM but I ch...

Read more »

Transformation of Several Variables in a Dataframe

February 1, 2012
By
Transformation of Several Variables in a Dataframe

This is how I transform several columns of a dataframe, i.e., with count-data into binary coded data (this would apply also for any other conversion..).count1

Read more »

A Short Example with R-Package osmar..

January 26, 2012
By
A Short Example with R-Package osmar..

Following up my last post in which I praised the capabilities of the osmar-package I give a short example...ps: You can also find this example at GitHub HERE.library(osmar) # this pulls the data from the OSM-Api:mydistrict <- get_osm(relation(85647)...

Read more »

osmar – Don’t Miss this New R-Geo-Package!

January 26, 2012
By
osmar – Don’t Miss this New R-Geo-Package!

The osmar-package enables you to retrieve all geographic elements of OpenStreetMap via its API.I.e., you can retrieve a street, river, state-boundary or whatever and use this as a spatial object in R.It's overwhelming thinking of the endless playg...

Read more »

R-Function to Source all Functions from a GitHub Repository

January 1, 2012
By
R-Function to Source all Functions from a GitHub Repository

Here's a function that sources all scripts from an arbitrary github-repository. At the moment the function downloads the whole repo and sources functions kept in a folder named "Functions" - this may be adapted for everyones own purpose.# Script name: ...

Read more »

Blog Statistics with StatCounter & R

December 19, 2011
By
Blog Statistics with StatCounter & R

If you're interested in analysing your blog's statistics this can easily be done with a web-service like StatCounter (free, only registration needed, quite extensive service) and with R.After implementing the StatCounter script in the html code of a we...

Read more »

Function to Collect Geographic Coordinates for IP-Addresses

December 17, 2011
By
Function to Collect Geographic Coordinates for IP-Addresses

I added the function IPtoXY to theBioBucket-Archives which collects geographic coordinates for IP-addresses.It uses a web-service at http://www.datasciencetoolkit.org// and works with the base R-packages. # System time to collect coordinates of 100 IP-...

Read more »

Conversion of Several Variables to Factors

December 15, 2011
By
Conversion of Several Variables to Factors

..often needed when preparing data for analysis (and usually forgotten until I need it for the next time).With the below code I convert a set of variables to factors - it could be that there are slicker ways to do it (if you know one let me know!) > da...

Read more »

Some Fun with googleVis – Mapping Blog Visits on Google Map

December 13, 2011
By
Some Fun with googleVis – Mapping Blog Visits on Google Map

See stand-alone code to produce this map below.Read more »

Read more »

Default Convenience Functions in R (Rprofile.site)

December 12, 2011
By
Default Convenience Functions in R (Rprofile.site)

I keep my blog-reference-functions, snippets, etc., at github and want to source them from there. This can be achieved by utilizing a function (source_https, customized for my purpose HERE). The original function was provided by the R-Blogger Tony Brey...

Read more »