Here you will find daily news and tutorials about R, contributed by over 450 bloggers.
You can subscribe for e-mail updates:
And get updates to your Facebook:
If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)
How to apply the same changes to several dataframes andsave them to CSV: # a dataframea <- data.frame(x = 1:3, y = 4:6)# make a list of several dataframes, then apply function (change column names, e.g.):my.list <- list(a, a)my.list <- lapply(...
Say, you have a text and you want to retrieve the cited names and years of publication. You wouldn't want to this by hand, wouldn't you?Try the following approach:(the text sample comes from THIS freely available publication)library(stringr)(txt <- ...
I'm currently trying to model species presence / absence data (N = 523) that were collected over a geographic area and are possibly spatially autocorrelated. Samples come from preferential sites (sea level > 1200 m, obligatory presence of permanent ...
On Stackoverflow I found this useful example on how to apply custom statistics on a dataframe and return the results as list or dataframe:somedata<- data.frame(  ...
Expanding on a question on Stack Overflow I'll show how to make a stratified random sample of a certain size: d <- expand.grid(id = 1:35000, stratum = letters)p = 0.1dsample <- data.frame()system.time(for(i in levels(d$stratum)) { dsub <...
I used this idea posted on Stack Overflow to plug together a function for reading data from Google Docs spreadsheets into R. google_ss <- function(gid = NA, key = NA) { if (is.na(gid)) {stop("\nWorksheetnumber (gid) is missing\n")} if (is....
Lattice graphs can be quite tedious. I don't use them too often and when I need them I usually have to dig the archives for the parameter-details.The here presented example may serve as a welcome template for the usage of panel functions, panel o...
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...
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
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)...