May 2015

Is This How You Dplyr?

May 27, 2015 | Jeffrey Horner

Yesterday I ran into a fairly complex issue regarding dplyr mutation and I wanted to get your take on my solution. I have two data frames with the same identifiers and two different date columns which I need to merge into one date column, with the val... [Read more...]

BMC favors source code plagiarism

May 27, 2015 | R on Guangchuang Yu

I found source code plagiarism a year ago and reported this case to BMC Systems Biology: I listed source code of many functions that are exactly copied from GOSemSim with only function name changed in my email. The detail of source code plagiarism can also be found at Proper use ...
[Read more...]

R Recipe: Aligning Axes in ggplot2

May 27, 2015 | Andrew Collier

Faceted plots in ggplot2 are phenomenal. They give you a simple way to break down an array of plots according to the values of one or more categorical variables. But what if you want to stack plots of different variables? Not quite so simple. But certainly possible. I gathered together ... [Read more...]

the Flatland paradox [#2]

May 26, 2015 | xi'an

Another trip in the métro today (to work with Pierre Jacob and Lawrence Murray in a Paris Anticafé!, as the University was closed) led me to infer—warning!, this is not the exact distribution!—the distribution of x, namely since a path x of length l(x) will corresponds ...
[Read more...]

New package on CRAN: lamW

May 26, 2015 | Avraham

Recently, in various research projects, the Lambert-W function arose a number of times. Somewhat frustratingly, there is no built-in function in R to calculate it. The only options were those in the gsl and LambertW packages, the latter merely importing the former. Importing the entire GNU Scientific Library (GSL) can ... [Read more...]

Granger Causality Test

May 25, 2015 | statcompute

[This article was first published on Yet Another Blog in Statistical Computing » S+/R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. # READ QUARTERLY DATA FROM CSV library(zoo) ts1 <- read.zoo('Documents/data/macros.csv', header = T, sep = ",", FUN = as.yearqtr) # CONVERT THE DATA TO STATIONARY TIME SERIES ts1$hpi_rate <- log(ts1$hpi / lag(ts1$hpi)) ts1$unemp_rate <- log(ts1$unemp / lag(ts1$unemp)) ts2 <- ts1[1:nrow(ts1) - 1, c(3, 4)] # METHOD 1: LMTEST PACKAGE library(lmtest) grangertest(unemp_rate ~ hpi_rate, order = 1, data = ts2) # Granger causality test # # Model 1: unemp_rate ~ Lags(unemp_rate, 1:1) + Lags(hpi_rate, 1:1) # Model 2: unemp_rate ~ Lags(unemp_rate, 1:1) # Res.Df Df F Pr(>F) # 1 55 # 2 56 -1 4.5419 0.03756 * # --- # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 # METHOD 2: VARS PACKAGE library(vars) var <- VAR(ts2, p = 1, type = "const") causality(var, cause = "hpi_rate")$Granger # Granger causality H0: hpi_rate do not Granger-cause unemp_rate # # data: VAR object var # F-Test = 4.5419, [...] [Read more...]

Open data sets you can use with R

May 25, 2015 | David Smith

R is an environment for programming with data, so unless you're doing a simulation study you'll need some data to work with. If you don't have data of your own, we've made a list of open data sets you can use with R to accompany the latest release of Revolution ... [Read more...]

Google Summer of Code: Community Bonding Re-cap

May 25, 2015 | jasdumas

Today is the day! The first day of coding for the 2015 Google Summer of code program begins today. I didn’t write an announcement piece in April, but I’m onboard now and will write a new blog post here every week for the duration of the summer. April 27th ... [Read more...]

Paper Helicopter experiment, part II

May 25, 2015 | Wingfeet

Last week I created a JAGS model combining data from two paper helicopter datasets. This week, I will use the model to find the longest flying one.PredictingThe JAGS/RJAGS system has no predict() function that I know of. What I therefore did is adapt t... [Read more...]

Geomorph update 2.1.5 Now Available!

May 24, 2015 | Emma Sherratt

Geomorph users,We have uploaded version 2.1.5 of geomorph* to CRAN. The windows and mac binaries have been compiled and the tarball is available.New Features:New Auto Mode allows users to include pre-digitized landmarks added to build.te... [Read more...]

another viral math puzzle

May 24, 2015 | xi'an

After the Singapore Maths Olympiad birthday problem that went viral, here is a Vietnamese primary school puzzle that made the frontline in The Guardian. The question is: Fill the empty slots with all integers from 1 to 9 for the equality to hold. In other words, find a,b,c,d,e,...
[Read more...]
1 2 3 4 5 12

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)