First steps of using googleVis on shiny
The guys at RStudio have done a fantastic job with shiny. It is really easy to build web apps with R using shiny. With the help of Joe Cheng from RStudio we figured out a way to make googleVis work on shiny as well. This allows you to make use of the Google Charts Tools in your shiny app directly from R. What I present here are three initial examples which seem to work in most browsers. The third example even uses a neat trick to create an animated geo chart.

However, before we upload the next version of googleVis to CRAN we decided to present a preview of version 0.4.0 here, asking for feedback. It would not be fair on the guys behind CRAN to release something into the wild, only to be told by users within a few days that we missed something. Hence, you can get the new version of googleVis only from the download page of our project site for the time being.
You may have read the post on RStudio's blog that the shiny API changed slightly: the
To run the following examples you need shiny version 0.4.0 and googleVis version 0.4.0 or higher.

However, before we upload the next version of googleVis to CRAN we decided to present a preview of version 0.4.0 here, asking for feedback. It would not be fair on the guys behind CRAN to release something into the wild, only to be told by users within a few days that we missed something. Hence, you can get the new version of googleVis only from the download page of our project site for the time being.
You may have read the post on RStudio's blog that the shiny API changed slightly: the
reactivePlot and reactiveText functions have been renamed to renderPlot and renderText with simplified input parameters. Thanks to Joe, there is now also a renderGvis function as part of the googleVis package, which works in very much the same way as the other two. To run the following examples you need shiny version 0.4.0 and googleVis version 0.4.0 or higher.
26 Feb 2013
06:47
animation
,
googleVis
,
gvisGeoChart
,
gvisScatterChart
,
gvisTable
,
map
,
R
,
RStudio
,
shiny
,
Tutorials
Registration for 'R in Insurance' conference has opened
The registration for the first conference on R in Insurance on Monday 15 July 2013 at Cass Business School in London has opened.
The intended audience of the conference includes both academics and practitioners who are active or interested in the applications of R in insurance.
The 2013 R in Insurance conference builds upon the success of the R in Finance and R/Rmetrics events. We expect invited keynote lectures by:
- Professor Alexander McNeil, Department of Actuarial Science & Statistics
Heriot-Watt University: Implementing CreditRisk+ in R with the Faster Fourier Transform - Trevor Maynard, Head of Exposure Management and Reinsurance, Lloyd's: There is an R in Lloyd's
The submission deadline for abstracts is 28 March 2013. Please email your abstract (in txt or pdf format) to rinsuranceconference at gmail dot com.
The conference committee consists of:
Details about the registration and abstract submission are given on the new dedicated R in Insurance page at Cass Business School.
The organisers, Andreas Tsanakas and Markus Gesmann, gratefully acknowledge the sponsorship of Mango Solutions.
19 Feb 2013
19:30
2013
,
Cass Business School
,
Conference
,
Insurance
,
News
,
R
,
R in Insurance
New Data Scientist role at Lloyd's
Lloyd's of London is looking for a Data Scientist as part of the Analysis team. See Lloyd's career web site for more details.
Review: Kölner R Meeting 6 February 2013
The fourth Cologne R user meeting took place last Wednesday at the Institute of Sociology. Thanks to Bernd Weiß for hosting the event and Revolution Analytics for their sponsorship.
We had two fantastic talks by Klaus Jacobi and M.eik Michalke. Klaus talked about Eliminating cloud pixels in satellite images via chronological interpolation and Meik presented his new roxyPackage package, which makes it even easier to maintain R packages with roxygen2.
About half of the fresh water in some regions of Pakistan is sourced from snow meting during the spring season. The water is captured in dams and as the snow only melts slowly the water supply is much more predictable than the water from the monsoon season, which is the other key source of fresh water during the year.
We had two fantastic talks by Klaus Jacobi and M.eik Michalke. Klaus talked about Eliminating cloud pixels in satellite images via chronological interpolation and Meik presented his new roxyPackage package, which makes it even easier to maintain R packages with roxygen2.
Eliminating cloud pixels in satellite images via chronological interpolation
Klaus gave a great case study about his consulting work as a water engineer in Asia, where he used R to analyse the snow melting process in the mountains of Pakistan.![]() |
| Images of snow melting over time. Klaus Jacobi |
About half of the fresh water in some regions of Pakistan is sourced from snow meting during the spring season. The water is captured in dams and as the snow only melts slowly the water supply is much more predictable than the water from the monsoon season, which is the other key source of fresh water during the year.
12 Feb 2013
17:49
Koelner R User
,
Kölner R Users
,
R
,
roxygen2
,
roxyPackage
,
snowmelt-runoff model
Next Kölner R User Meeting: 6 February 2013
Quick reminder: The next Cologne R user group meeting is scheduled for tomorrow, 6 February 2013. All details and the agenda are available on the KölnRUG Meetup site. Please sign up if you would like to come along. Notes from the last Cologne R user group meeting are available here.
Thanks also to Revolution Analytics, who are sponsoring the Cologne R user group as part of their vector programme.
5 Feb 2013
07:08
Kölner R Users
,
KölnR
,
News
,
R
,
Soapbox
Follow the ants to richness
A friend of mine told me the secret of making money at the stock market. "It's easy", he said.
All I would have to do is to buy a big jar of ants. Then I should observe the ants movement on my kitchen table, while following the stock market.
I shall keep the ants which walk in line with the stock market and remove those who don't. Eventually I would have one ant left that walked all the way in line with the stock market.
Bingo! This is the one I have to keep feeding well and observe, as it clearly can predict the movements of the stock market.
For more complex problems I recommend to use animals with bigger brains.
All I would have to do is to buy a big jar of ants. Then I should observe the ants movement on my kitchen table, while following the stock market.
I shall keep the ants which walk in line with the stock market and remove those who don't. Eventually I would have one ant left that walked all the way in line with the stock market.
Bingo! This is the one I have to keep feeding well and observe, as it clearly can predict the movements of the stock market.
For more complex problems I recommend to use animals with bigger brains.
29 Jan 2013
08:10
ants
,
R
,
random walk
,
Soapbox
,
stock market
Reserving based on log-incremental payments in R, part III
This is the third post about Christofides' paper on Regression models based on log-incremental payments [1]. The first post covered the fundamentals of Christofides' reserving model in sections A - F, the second focused on a more realistic example and model reduction of sections G - K. Today's post will wrap up the paper with sections L - M and discuss data normalisation and claims inflation.
I will use the same triangle of incremental claims data as introduced in my previous post. The final model had three parameters for origin periods and two parameters for development periods. It is possible to reduce the model further as Christofides illustrates in section L onwards by using an inflation index to bring all claims payments to current value and a claims volume adjustment or weight for each origin period to normalise the triangle.
In his example Christofides uses claims volume adjustments for the origin years and an earning or inflation index for the different payment calendar years. The claims volume adjustments aims to normalise the triangle for similar exposures across origin periods, while the earnings index, which measures largely wages and other forms of compensations, is used as a first proxy for claims inflation. Note that the earnings index shows significant year on year changes from 5% to 9%. Barnett and Zehnwirth [2] would probably recommend to add further parameters for the calendar year effects to the model.
I will use the same triangle of incremental claims data as introduced in my previous post. The final model had three parameters for origin periods and two parameters for development periods. It is possible to reduce the model further as Christofides illustrates in section L onwards by using an inflation index to bring all claims payments to current value and a claims volume adjustment or weight for each origin period to normalise the triangle.
In his example Christofides uses claims volume adjustments for the origin years and an earning or inflation index for the different payment calendar years. The claims volume adjustments aims to normalise the triangle for similar exposures across origin periods, while the earnings index, which measures largely wages and other forms of compensations, is used as a first proxy for claims inflation. Note that the earnings index shows significant year on year changes from 5% to 9%. Barnett and Zehnwirth [2] would probably recommend to add further parameters for the calendar year effects to the model.
# Page D5.36
ClaimsVolume <- data.frame(origin=0:6,
volume.index=c(1.43, 1.45, 1.52, 1.35, 1.29, 1.47, 1.91))
# Page D5.36
EarningIndex <- data.frame(cal=0:6,
earning.index=c(1.55, 1.41, 1.3, 1.23, 1.13, 1.05, 1))
# Year on year changes
round((1-EarningIndex$earning.index[-1]/EarningIndex$earning.index[-7]),2)
# [1] 0.09 0.08 0.05 0.08 0.07 0.05
dat <- merge(merge(dat, ClaimsVolume), EarningIndex)
# Normalise data for volume and earnings
dat$logvalue.ind.inf <- with(dat, log(value/volume.index*earning.index))
with(dat, interaction.plot(dev, origin, logvalue.ind.inf))
points(1+dat$dev, dat$logvalue.ind.inf, pch=16, cex=0.8)
Indeed, the interaction plot shows the various origin years now to be much more closely grouped. Only the single point of the last origin period stands out now.
Christofides tests several models with different numbers of origin levels, but I am happy with the minimal model using only one parameter for the origin period, namely the intercept:
22 Jan 2013
23:18
Actuarial
,
Barnett Zehnwirth
,
ChainLadder
,
IBNR
,
Insurance
,
linear model
,
log-incremental
,
R
,
reserving
,
Risk
,
Tutorials





