)
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#CCCCFF\""))
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#CCCCBB\""))
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#CCCCAA\""))
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#CCCCBB\""))
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#CCAABB\""))
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#AABBCC\""))
#
G <- gvisGeoChart(Exports, "Country", "Profit", #
                  options=list(width=200, height=100))#
T <- gvisTable(Exports, #
                  options=list(width=200, height=260))#
#
GT <- gvisMerge(G,T, horizontal=FALSE) #
plot(GT)#
#
M <- gvisMotionChart(Fruits, "Fruit", "Year",#
                     options=list(width=400, height=360))#
#
GTM <- gvisMerge(GT, M, horizontal=TRUE,#
                     tableOptions="bgcolor=\"#CCCCCC\" cellspacing=10")#
plot(GTM)#
#
#
line <- gvisLineChart(OpenClose, "Weekday", c("Open", "Close"), #
	      options=list(legend='none', width=300, height=150))#
column <- gvisColumnChart(OpenClose, "Weekday", c("Open", "Close"),#
              options=list(legend='none', width=300, height=150))#
area <- gvisAreaChart(OpenClose, "Weekday", c("Open", "Close"),#
              options=list(legend='none', width=300, height=150))#
bar <- gvisBarChart(OpenClose, "Weekday", c("Open", "Close"),#
              options=list(legend='none', width=300, height=150))#
LBCA <- gvisMerge(gvisMerge(line, bar), gvisMerge(column, area), TRUE) #
#
plot(LBCA)#
#
#
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#AABBCC\""))
library(googleVis)
plot(gvisMerge(GTM, LBCA, tableOptions="bgcolor=\"#AABBCC\""))
bar=gvisBarChart(OpenClose, "Weekday", c("Open", "Close"))
plot(bar)
print(bar, "~/Dropbox/Public/bar.html")
print(bar, file="~/Dropbox/Public/bar.html")
x=plot(bar)
library(googleVis)
?createGoogleGadget
Candle <- gvisCandlestickChart(OpenClose, xvar="Weekday", low="Low",#
                                      open="Open", close="Close",#
                                      high="High",#
                                      options=list(legend='none',#
                                        width=300, height=250))
Candle
library(googleVis)
?gvisMotionChart
?gvisGeoChart
# Create Google Gadget
GeoChart <- gvisGeoChart(Exports, "Country", "Profit",#
                         options=list(region="150"))
GeoChart
library(RODBC)
library(googleVIs)
library(googleVis)
GeoChart <- gvisGeoChart(Exports, "Country", "Profit",#
                         options=list(region="150"))
GeoChart
names(GeoChart)
names(GeoChart$html)
names(GeoChart$html$chart)
library(library)
M <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
plot(M)
library(googleVis)
x=read.table("~/Downloads/xppaut_latest/ode/fhnout.dat", sep="\")
x=read.table("~/Downloads/xppaut_latest/ode/fhnout.dat", sep="\t")
head(x)
x=read.table("~/Downloads/xppaut_latest/ode/fhnout.dat", sep=" ")
head(x)
x=x[,1:3]
names(x)=c("time", "v", "w")
head(x)
plot(gvisScatterChart(x))
?gvisScatterChart
plot(gvisScatterChart(x, options=lineWidth=2, pointSize=0))
plot(gvisScatterChart(x, options=list(lineWidth=2, pointSize=0)))
?gvisScatterChart
plot(gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, hAxis="{title:'time (ms)'}")))
?gvisAnnotatedTimeLine
plot(gvisAnnotatedTimeLine(x, datevar="time", numvar="v", options=list(lineWidth=2, pointSize=0, hAxis="{title:'time (ms)'}")))
x
reshape(x, varying=c("v", "w"),idvar="time", direction=long)
reshape(x, varying=c("v", "w"),idvar="time", direction="long")
?reshape
reshape(x, varying=c("v", "w"),idvar="time", direction="long", v.names="Var")
reshape(x, varying=list(2:3),idvar="time", direction="long", v.names="Var")
reshape(x, varying=list(2:3),idvar="time", direction="long", v.names="time")
y=reshape(x, varying=list(2:3),idvar="time", direction="long", v.names="time")
head(y)
y=reshape(x, varying=list(2:3),idvar="v", direction="long", v.names="time")
y=reshape(x, varying=list(2:3),idvar="time", direction="long", v.names=c("v", "w"))
y=reshape(x, varying=list(c("v", "w")),idvar="v", direction="long", v.names="time")
y=reshape(x, varying=list("v", "w"),idvar="v", direction="long", v.names="time")
head(y)
y=reshape(x, varying=list("v", "w"),idvar="v", direction="long", v.names="ti")
head(y)
y=reshape(x, varying=list("v", "w"),idvar=time", direction="long", v.names="ti")
y=reshape(x, varying=list("v", "w"),idvar=c("v","w"), direction="long", v.names="time")
head(y)
y=reshape(x, varying=list(2:3),idvar=c("v","w"), direction="long", v.names="time")
head(y)
y=reshape(x, varying=list(2:3),idvar=c("time"), direction="long", v.names="time")
head(y)
summary(Indometh)#
wide <- reshape(Indometh, v.names="conc", idvar="Subject",#
                timevar="time", direction="wide")#
wide#
#
reshape(wide, direction="long")#
reshape(wide, idvar="Subject", varying=list(2:12),#
        v.names="conc", direction="long")
head(wide)
head(x)
z=x[,1:2]
z1=x[,1:2]
z1$var="v"
z2=x[,c(1,3)]
z2$var="w"
=rbind(z1, z2)
z=rbind(z1, z2)
head(z1)
head(z2)
names(z1)=c("time", "val", "var")
names(z2)=c("time", "val", "var")
z=rbind(z1, z2)
plot(gvisAnnotatedTimeLine(x, datevar="time", numvar="val", idvar="var", options=list(lineWidth=2, pointSize=0, hAxis="{title:'time (ms)'}")))
plot(gvisAnnotatedTimeLine(z, datevar="time", numvar="val", idvar="var")
)
plot(gvisAnnotatedTimeLine(z, datevar="time", numvar="val", idvar="var"))
z$time
as.date(z$time)
plot(gvisScatterChart(x[,-1], options=lineWidth=2, pointSize=0))
plot(gvisScatterChart(x[,-1], options=list(lineWidth=2, pointSize=0)))
plot(gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, hAxis="{title:'time (ms)'}")))
x=(gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, hAxis="{title:'time (ms)'}")))
x=read.table("~/Downloads/xppaut_latest/ode/fhnout.dat", sep="\t")
x=read.table("~/Downloads/xppaut_latest/ode/fhnout.dat", sep=" ")
x=x[,1:3]
names(x)=c("time", "v", "w")
head(x)
#
plot1=gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, title="Fitz-Hugh Nagumo",hAxis="{title:'time (ms)'}"))#
#
plot(plot1)
#
plot2= gvisScatterChart(x[,-1], options=lineWidth=2, pointSize=0, #
	title="Fitz-Hugh Nagumo", hAxis="{title:'v'}",#
	yAxis="{title:'w'}", legend='none'))#
	#
plot(plot2)
#
plot2= gvisScatterChart(x[,-1], options=list(lineWidth=2, pointSize=0, #
	title="Fitz-Hugh Nagumo", hAxis="{title:'v'}",#
	yAxis="{title:'w'}", legend='none'))#
	#
plot(plot2)
#
plot2= gvisScatterChart(x[,-1], options=list(lineWidth=2, pointSize=0, #
	title="Fitz-Hugh Nagumo", hAxis="{title:'v'}",#
	vAxis="{title:'w'}", legend='none'))#
	#
plot(plot2)
write.csv(x, file="~/Dropbox/Public/xpp/fhn.csv")
x=read.csv("http://dl.dropbox.com/u/7586336/xpp/fhn.csv")
head(x)
print(plot1, file="~/Dropbox/Public/xpp/FHN1.html")
print(plot2, file="~/Dropbox/Public/xpp/FHN2a.html")
print(plot2, file="~/Dropbox/Public/xpp/FHN2.html")
plot(gvisMerge(plot1, plot2))
plot(gvisMerge(plot1, plot2, horizontal=TRUE))
plot3=(gvisMerge(plot1, plot2, horizontal=TRUE))
print(plot3, file="~/Dropbox/Public/xpp/FHN.html")
plot1=gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, title="FitzHugh-Nagumo",hAxis="{title:'time (ms)'}"))#
#
plot(plot1)#
#
plot2= gvisScatterChart(x[,-1], options=list(lineWidth=2, pointSize=0, #
	title="FitzHugh-Nagumo", hAxis="{title:'v'}",#
	vAxis="{title:'w'}", legend='none'))#
	#
plot(plot2)#
#
plot3 <- gvisMerge(plot1, plot2, horizontal=TRUE)#
#
plot(plot3)
plot1=gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, title="FitzHugh-Nagumo",hAxis="{title:'time (ms)'}"))
plot(plot1)
plot1=gvisLineChart(x, options=list(lineWidth=2, pointSize=0, title="FitzHugh-Nagumo",hAxis="{title:'time (ms)'}"))
plot(plot1)
head(x)
write.csv(x[,-1], file="~/Dropbox/Public/xpp/fhn.csv", rownames=FALSE)
write.csv(x[,-1], file="~/Dropbox/Public/xpp/fhn.csv", row.names=FALSE)
x=read.csv("http://dl.dropbox.com/u/7586336/xpp/fhn.csv")#
#
library(googleVis)#
#
plot1=gvisScatterChart(x, options=list(lineWidth=2, pointSize=0, title="FitzHugh-Nagumo",hAxis="{title:'time (ms)'}"))#
#
plot(plot1)
#
plot2= gvisScatterChart(x[,-1], options=list(lineWidth=2, pointSize=0, #
	title="FitzHugh-Nagumo", hAxis="{title:'v'}",#
	vAxis="{title:'w'}", legend='none'))#
	#
plot(plot2)#
#
plot3 <- gvisMerge(plot1, plot2, horizontal=TRUE)#
#
plot(plot3)
print(plot1, file="~/Dropbox/Public/xpp/FHN1.html")
print(plot2, file="~/Dropbox/Public/xpp/FHN2.html")
print(plot3, file="~/Dropbox/Public/xpp/FHN.html")
plot3$caption
plot3$html$caption
plot3$html$caption="<pre># Forced Fitzhugh-Nagumo fhn.ode #
dv/dt = f(v)-w+s(t)+I_0#
dw/dt = eps*(v-gamma*w)#
f(v)=v*(1-v)*(v-a)#
s(t)=al*sin(omega*t)#
param a=.25,eps=.05,gamma=1,I_0=.25#
param al=0,omega=2#
@ total=100,dt=.2,xhi=100#
done#
</pre>"
plot(plot3)
plot3$html$caption="<pre># Forced Fitzhugh-Nagumo, XPP fhn.ode #
dv/dt = f(v)-w+s(t)+I_0#
dw/dt = eps*(v-gamma*w)#
f(v)=v*(1-v)*(v-a)#
s(t)=al*sin(omega*t)#
param a=.25,eps=.05,gamma=1,I_0=.25#
param al=0,omega=2#
@ total=100,dt=.2,xhi=100#
done#
</pre>"
print(plot3, file="~/Dropbox/Public/xpp/FHN.html")
fn="https://spreadsheets.google.com/spreadsheet/ccc?key=0Ai35Mtg9R9_RdHV0WkRTMzdTVVI3NHJtMHhmWVVHOXc&hl=en_GB&pli=1#gid=0"
read.csv(fn)
install.packages("RGoogleDocs")
install.packages("RCurl")
library(RCurl)
library(RGoogleDocs)
auth = getGoogleAuth("markus.gesmann@gmail.com", "=b33rlage=")#
#
con = getGoogleDocsConnection(auth)
con
auth
 con$getDocs()#
 names(con)
 getDocs(con)
docs getDocs(con)#
 names(docs)
docs = getDocs(con)#
 names(docs)
getDocContent(docs[["googleVis Feedback"]], con)
getDocContent(docs[["Fruits"]], con)
docs[["Fruits"]]
? getDocContent
getDocs(docs[["Fruits"]], con)
getDocs(con)
getWorksheets("Fruits", con)
docs
names(docs)
docs[[2]]
getWorksheets(docs[[2]], con)
names(docs)
getWorksheets(docs[[6]], con)
getWorksheets(docs[["Fruits"]], con)
getWorksheets("Fruits", con)
auth = getGoogleAuth("markus.gesmann@gmail.com", "=b33rlage=", "wise")#
#
con = getGoogleDocsConnection(auth)
getWorksheets("Fruits", con)
getWorksheets(docs[["Fruits"]], con)
sheets  <- getWorksheets(docs[["Fruits"]], con)
names(sheets)
sheets[,]
sheets[,1]
sheets
sheets[["Sheet 1"]]
sheets[["title"]]
url(sheets)
connection(sheets)
readDoc(docs[["Fruits"]], con)
x=readDoc(docs[["Fruits"]], con)
x
x= sheetAsMatrix(docs[["Fruits"]], con)
sheets  <- getWorksheets(docs[["Fruits"]], con)
x= sheetAsMatrix(sheets)
sheet
sheets
as(sheets, "data.frame")
as(sheets['Sheet 1'], "data.frame")
as(sheets[['Sheet 1']], "data.frame")
myDF=as(sheets[['Sheet 1']], "data.frame")
, header=TRUE
myDF=as(sheets[['Sheet 1']], "data.frame", header=TRUE)
sheetAsMatrix(sheets[['Sheet 1']], TRUE)
myDF=sheetAsMatrix(sheets[['Sheet 1']], TRUE)
class(myDF)
 names(docs)
sheets  <- getWorksheets(docs[["googleVis Feedback"]], con)
sheets
myDF=sheetAsMatrix(sheets[['Sheet1']], TRUE)
as(sheets[['Sheet1']], "data.frame")
library(ChainLadder)
RAA
as.data.frame(RAA)
as.data.frame(RAA, na.rm=TRUE)
x=as.data.frame(RAA, na.rm=TRUE)
library(googleVis)
plot(gvisLineChart(x))
class(x)
plot(gvisLineChart(as.data.frame(x)))
x=as.data.frame(x))
x=as.data.frame(x)
head(x)
RAA
plot(gvisLineChart(RAA))
plot(gvisAnnotatedTimeLine(x, "origin", "value", "dev"))
plot(gvisAnnotatedTimeLine(x, "dev", "value", "origin"))
# Cashflow projections and other stuff#
# February/March 2011 - Willem Kerstholt, w.kerstholt@gmail.com / w.kerstholt@interpolis.nl#
#
################################
# Select a subset of a full triangle (contradictio in terminis) #
partial.tri	<-	function(x, part = "PAST", firstyear = TRUE, firstperiod = 1){#
		x		<-	as.matrix(x)#
		dimx	<-	dim(x)#
		#
		if (part=="PAST"){output <- as.triangle(t(row(x)+col(x) <= dimx[1] + 1) * x)}#
		if (part=="FUT"){output <- as.triangle(t(row(x)+col(x) > dimx[1] + 1) * x)}#
		if (part=="FUT" & firstyear == FALSE){output <- as.triangle(t(row(x)+col(x) > dimx[1] + 1 + firstperiod)  * x)}#
		if (part=="FUT" & firstperiod > 1){output <- as.triangle(t(row(x)+col(x) > dimx[1] + 1 + firstperiod)  * x)}#
#
	output#
	}#
#
#
################################
# Strip future cash flow#
strip_fcf	<-	function(x,rows_to_remove=1){#
	for(i in 1:rows_to_remove){#
		diag(x[,-(1:i)][(dim(x)[1]):1,])	<-	0#
		}#
	x#
}#
#
#
################################
# Calculate one-year prior year risk#
pyr	<-	function(x,periods_in_first_year=1){#
	output	<-	list()#
	#
	output$bootraa_tri_cy	<-	x$IBNR.Triangles	#
	output$bootraa_tri_fy	<-	output$bootraa_tri_cy#
	for(i in 1:dim(output$bootraa_tri_cy)[3]){#
		output$bootraa_tri_fy[,,i]	<-	strip_fcf(output$bootraa_tri_cy[,,i],rows_to_remove=periods_in_first_year)#
		}#
#
	output$run_off		<-	apply(output$bootraa_tri_fy, 3, sum)#
	output$pyr_sims		<-	output$run_off - mean(output$run_off)#
#
	points		<-	c(.5,.9,.95,.995,.9995)#
	output$pyr	<-	quantile(output$pyr_sims,points)#
	return(output)#
}#
#
#
################################
# Peels the newest diagonal off a triangle#
peel	<-	function(dataset,diagonals=0){#
	if(diagonals<=0){cat('Nothign to peel! \n\n');return(dataset)}#
	if((diagonals>dim(dataset)[1])==TRUE){return(cat("Dataset has fewer diagonals than peelings requested\n"))}#
	for(i in 1:diagonals){#
		dimensions_dataset							<-	dim(dataset)#
		diag(dataset[dimensions_dataset[1]:1,])		<-	NA#
		dataset										<-	dataset[1:(dimensions_dataset[1]-1),1:(dimensions_dataset[1]-1)]#
	}#
	return(dataset)#
}#
#
	MackCL		<-	MackChainLadder(RAA)#
	BootCL		<-	BootChainLadder(RAA)#
	MunCL 		<-	MunichChainLadder(MCLpaid, MCLincurred, est.sigmaP=0.1, est.sigmaI=0.1)#
	MultiCL 	<-	MultiChainLadder(liab)#
#
###################################
#
#
#
#
# Their parts#
	str(MackCL,		max.level=1)#
	str(BootCL,		max.level=1)#
	str(MunCL,		max.level=1)#
	str(MultiCL,	max.level=2)#
#
###################################
#
# Full Triangles#
	MackCL$FullTriangle#
	BootCL$IBNR.Triangles # not full triangle#
	MunCL$MCLPaid#
		MunCL$MackPaid$FullTriangle	# sidestep#
	MultiCL$FullTriangles#
#
	dim(MackCL$FullTriangle)#
	dim(BootCL$IBNR.Triangles)#
	dim(MunCL$MCLPaid) # different size due to different input#
	dim(MultiCL$FullTriangles) # idem#
#
###################################
	#
# Mack Chain Ladder cashflows#
	FullTriangle	<-	MackCL$FullTriangle#
	payments		<-	cum2incr(FullTriangle)#
	#
	(future_payments		<-	partial.tri(payments,'FUT'))#
	#
	provision			<-	apply(future_payments,1,sum)#
	future_payments / provision#
	#
	fp_long				<-	as.data.frame(future_payments)#
	fp_long$diagonal	<-	fp_long$dev + fp_long$origin - 1#
#
	(cashflow			<-	round(with(fp_long,tapply(value,diagonal,sum)))) # Cashflow projection#
	(round(cf_pattrn	<-	cashflow / sum(cashflow),3)) # Cashflow pattern#
	#
	devpattrn	<-	cumprod(MackCL$f) / prod(MackCL$f)	# Development pattern#
	plot(devpattrn,type='b',ylim=c(0,1))#
	#
	Mack_cf_pattrn	<-	cf_pattrn#
	#
###################################
	#
# Bootstrap Chain Ladder#
	dim(BootCL$IBNR.Triangles)#
#
	provision	<-	apply(BootCL$IBNR.Triangles, 3, function(x){apply(x,1,sum)})#
	apply(provision,1,mean) # IBNR per year#
	BootCL # is equal to apply(provision,1,mean) above :)#
	#
	hist(apply(provision,2,sum)) # equal to left-top of plot(BootCL)#
#
	bcashflows	<-	apply(BootCL$IBNR.Triangles, 3, function(x){#
		temp	 <-	as.data.frame(as.triangle((x)))#
		temp$diagonal	<-	temp$dev + temp$origin - 1#
		with(temp,tapply(value,diagonal,sum))#
	})#
#
	(cashflow	<-	apply(bcashflows,1,mean)) # Best estimate#
	sum(apply(bcashflows,1,mean))#
	summary(BootCL)$Totals[3,1]#
#
	(round(cf_pattrn	<-	cashflow / sum(cashflow),3)) # Cashflow pattern#
	#
	(Boot_cf_pattern	<-	cf_pattrn)#
	(Mack_cf_pattrn)#
	#
	# Reserve runoff#
		pyrbcl	<-	pyr(BootCL)#
		pyrbcl$pyr	# See the other file for an illustration#
		quantile(pyrbcl$pyr_sims)#
	#
# Munich Chain Ladder#
	FullTriangle	<-	MunCL$MCLPaid#
	payments		<-	cum2incr(FullTriangle)#
	#
	(future_payments		<-	partial.tri(payments,'FUT'))#
	#
	provision			<-	apply(future_payments,1,sum)#
	#
	future_payments / provision#
	#
	fp_long				<-	as.data.frame(future_payments)#
	fp_long$diagonal	<-	fp_long$dev + fp_long$origin - 1#
#
	(cashflow			<-	round(with(fp_long,tapply(value,diagonal,sum)))) # Cashflow projection#
	(round(cf_pattrn	<-	cashflow / sum(cashflow),3)) # Cashflow pattern#
	#
	sum(cashflow)#
	summary(MunCL)$Totals#
	summary(MunCL)$Totals[2,1] - summary(MunCL)$Totals[1,1]#
	# Not perfectly equal#
	#
# Multivariate Chain Ladder#
	FullTriangle	<-	as.triangle(MultiCL$FullTriangles[[1]] + MultiCL$FullTriangles[[2]])#
	payments		<-	cum2incr(FullTriangle)#
	#
	(future_payments		<-	partial.tri(payments,'FUT'))#
	#
	provision			<-	apply(future_payments,1,sum)#
	#
	future_payments / provision#
	#
	fp_long				<-	as.data.frame(future_payments)#
	fp_long$diagonal	<-	fp_long$dev + fp_long$origin - 1#
#
	(cashflow			<-	round(with(fp_long,tapply(value,diagonal,sum)))) # Cashflow projection#
	(round(cf_pattrn	<-	cashflow / sum(cashflow),3)) # Cashflow pattern#
	#
	sum(cashflow)#
	MultiCL#
#
# Puts the above in a function#
# Uses class(x) to distinguish between the models#
#
	cashflows	<-	function(model){#
		output	<-	list()#
		inputcheck	<-	0#
		#
		if("BootChainLadder" %in% class(model)){#
			inputcheck	<-	1#
			bs_provision		<-	apply(model$IBNR.Triangles, 3, function(x){apply(x,1,sum)})#
			output$provision	<-	apply(bs_provision,1,mean) # IBNR per year#
			#
			output$bcashflows	<-	apply(model$IBNR.Triangles, 3, function(x){#
				temp	 <-	as.data.frame(as.triangle((x)))#
				temp$diagonal	<-	temp$dev + temp$origin - 1#
				with(temp,tapply(value,diagonal,sum))#
			})#
#
			(output$cashflow	<-	apply(output$bcashflows,1,mean)) # Best estimate#
			(round(output$cf_pattrn	<-	output$cashflow / sum(output$cashflow),3)) # Cashflow pattern#
			return(output)#
			} else#
		#
		if("MackChainLadder" %in% class(model)){FullTriangle	<-	model$FullTriangle; inputcheck	<-	1} else#
		if("MunichChainLadder" %in% class(model)){FullTriangle	<-	model$MCLPaid; inputcheck	<-	1} else#
		if("MultiChainLadder" %in% class(model)){FullTriangle	<-	as.triangle(model$FullTriangles[[1]] + model$FullTriangles[[2]]);inputcheck	<-	1}#
	#
		if(inputcheck == 1){#
			payments			<-	cum2incr(FullTriangle)#
			(future_payments	<-	partial.tri(payments,'FUT'))#
			#
			output$provision	<-	apply(future_payments,1,sum)#
			#
			fp_long				<-	as.data.frame(future_payments)#
			fp_long$diagonal	<-	fp_long$dev + fp_long$origin - 1#
#
			(output$cashflow			<-	round(with(fp_long,tapply(value,diagonal,sum)))) # Cashflow projection#
			(round(output$cf_pattrn	<-	output$cashflow / sum(output$cashflow),3)) # Cashflow pattern#
			return(output)#
			} else {return('Are you sure you are inputting a ChainLadder-object')}#
		}#
		#
	cashflows(MackCL)#
	cashflows(BootCL)#
	cashflows(MunCL)#
	cashflows(MultiCL)#
	cashflows(c(1,2))
library(RJSONIO)
toJSON(women)
cat(toJSON(women))
cat(toJSON(women,TRUE))
cat(toJSON(women,FALSE))
x=rnorm(100000)
y=(toJSON(x,FALSE))
y=(toJSON(x,TRUE))
x=rnorm(1000000)
object.size(x)
object.size(x)/1e6
y=(toJSON(x,TRUE))
y=(toJSON(x,FALSE))
library(googleVis)
M <- gvisMotionChart(Fruits, "Fruit", "Year")
plot(M)
G <- gvisGeoChart(Exports, "Country", "Profit",#
options=list(width=200, height=100))#
T <- gvisTable(Exports, options=list(width=200, height=270))#
M <- gvisMotionChart(Fruits, "Fruit", "Year",#
options=list(width=400, height=370))#
GT <- gvisMerge(G,T, horizontal=FALSE)#
GTM <- gvisMerge(GT, M, horizontal=TRUE,#
tableOptions="bgcolor= ̈#CCCCCC ̈ cellspacing=10")#
plot(GTM)
G <- gvisGeoChart(Exports, "Country", "Profit",#
options=list(width=200, height=100))#
T <- gvisTable(Exports, options=list(width=200, height=270))#
M <- gvisMotionChart(Fruits, "Fruit", "Year",#
options=list(width=400, height=370))#
GT <- gvisMerge(G,T, horizontal=FALSE)#
GTM <- gvisMerge(GT, M, horizontal=TRUE,#
tableOptions="bgcolor= \"#CCCCCC\" cellspacing=10")#
plot(GTM)
library(googleVis)
M <- gvisMotionChart(Fruits, "Fruit", "Year")
createGoogleGadget(M)
cat(createGoogleGadget(M))
?createGoogleGadget
women
Scatter <- gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0, #
                 title="Women", vAxis="{title:'weight'}",#
                 hAxis="{title:'height'}", width=300, height=300))
plot(Scatter)
?women
Scatter <- gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0, #
                 title="Women", vAxis="{title:'weight (lbs)'}",#
                 hAxis="{title:'height (in)'}", width=300, height=300))
plot(Scatter)
Scatter <- gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0,#
                 title="Women", vAxis="{title:'weight (lbs)'}",#
                 hAxis="{title:'height (in)'}", width=300, height=300))#
                 #
plot(Scatter)
setwd("~/Dropbox/google-motion-charts-with-r/inst/gadgets/")
dir()
## Scatter chart#
Scatter <- gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0, #
                 title="Women", vAxis="{title:'weight (lbs)'}",#
                 hAxis="{title:'height (in)'}", width=300, height=300))#
                 #
cat(createGoogleGadget(Scatter), file="scatterchart.xml")
demo(package="googleVis")
