[R] error with geomap in googleVis

Gesmann, Markus Markus.Gesmann at lloyds.com
Fri Jun 10 12:06:47 CEST 2011


Hi Mike,

I believe you are trying to put two charts on the same page.
The demo(googleVis) provides you with an example for this.
So applying the same approach to your data sets would require:

library(googleVis)
df<-data.frame(foo=c("Brazil","Canada"), bar=c(123,456))

map1<-gvisGeoMap(df,locationvar='foo',numvar='bar')
m<-gvisMotionChart(Fruits,idvar="Fruit",timevar="Year")

## Build a new gvis object based on the exsiting ones
ComboChart <- structure(list(type='GeoMapMotionChart',
		 	chartid='myComboChart', 
		 	html=list(header=map1$html$header,
		      chart=list(map1$html$chart, # Geo Map
			           m$html$chart),   # Motion Chart
                  caption="Combination of various googleVis outputs <BR
/>", 
                  footer=map1$html$footer)),  
		      class=c("gvis", "list")
			)
plot(ComboChart)


I hope this helps.

Kind regards,

Markus

-----Original Message-----
From: Mike Marchywka [mailto:marchywka at hotmail.com] 
Sent: 09 June 2011 19:12
To: Gesmann, Markus; mjphipps at tpg.com.au; r-help at stat.math.ethz.ch
Subject: RE: [R] error with geomap in googleVis



I still got blanks with Firefox with the two examples below, I put html
up here if you want to look at it,

http://98.129.232.232/xxx.html

I just downloaded googlevis from mirror 68 and it claimed it was 0.2.5 (
I thought, but maybe I should check again). 


install.packages("googleVis",dep=T)
library(googleVis)
df<-data.frame(foo=c("Brazil","Canada"), bar=c(123,456))
map1<-gvisGeoMap(df,locationvar='foo',numvar='bar')

cat(map1$html$header,filename="xxx.html",append=F)
cat(map1$html$header,file="xxx.html",append=F)
cat(map1$html$chart,file="xxx.html",append=T)
cat(map1$html$caption,file="xxx.html",append=T)
cat(map1$html$footer,file="xxx.html",append=T)
m<-gvisMotionChart(Fruits,idvar="Fruit",timevar="Year")
str(m)
cat(m$html$header,file="xxx.html",append=F)
cat(m$html$chart,file="xxx.html",append=T)
cat(m$html$caption,file="xxx.html",append=T)
cat(m$html$footer,file="xxx.html",append=T)



----------------------------------------
> Subject: RE: [R] error with geomap in googleVis
> Date: Thu, 9 Jun 2011 14:06:22 +0100
> From: Markus.Gesmann at lloyds.com
> To: marchywka at hotmail.com; mjphipps at tpg.com.au; 
> r-help at stat.math.ethz.ch
>
> Hi all,
>
> This issue occurs with googleVis 0.2.4 and RJSONIO > 0.7.1.
> Version 0.2.5 of the googleVis package has been uploaded to CRAN two 
> days ago and should have fixed this issue.
> Can you please try to update to that version, e.g. from 
> http://cran.r-project.org/web/packages/googleVis/
>
> Further version 0.2.5 provides new interfaces to more interactive 
> Google
> charts:
> - gvisLineChart
> - gvisBarChart
> - gvisColumnChart
> - gvisAreaChart
> - gvisScatterChart
> - gvisPieChart
> - gvisGauge
> - gvisOrgChart
> - gvisIntensityMap
>
> Additionally a new demo 'AnimatedGeoMap' has been added which shows 
> how a Geo Map can be animated with additional JavaScript. Thanks to 
> Manoj Ananthapadmanabhan and Anand Ramalingam, who provided the idea 
> and initial code.
>
> For more information and examples see:
> http://code.google.com/p/google-motion-charts-with-r/
>
> I hope this helps
>
> Markus
>
> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org]
> On Behalf Of Mike Marchywka
> Sent: 09 June 2011 11:19
> To: mjphipps at tpg.com.au; r-help at stat.math.ethz.ch
> Subject: Re: [R] error with geomap in googleVis
>
>
>
> ----------------------------------------
> > To: r-help at stat.math.ethz.ch
> > From: mjphipps at tpg.com.au
> > Date: Wed, 8 Jun 2011 10:14:01 +0000
> > Subject: Re: [R] error with geomap in googleVis
> >
> > SNV Krishna primps.com.sg> writes:
> >
> > >
> > > Hi All,
> > >
> > > I am unable to get the plot geomap in googleVis package. data is 
> > > as follows
> > >
> > > > head(index.ret)
> > > country ytd
> > > 1 Argentina -10.18
> > > 2 Australia -3.42
> > > 3 Austria -2.70
> > > 4 Belgium 1.94
> > > 5 Brazil -7.16
> > > 6 Canada 0.56
> > >
> > > > map1 = gvisGeoMap(index.ret,locationvar = 'country', numvar =
> > > > 'ytd')
> > > > plot(map1)
> > >
> > > But it just displays a blank page, showing an error symbol at the 
> > > right bottom corner. I tried demo(googleVis), it also had a 
> > > similar problem. The demo showed all other plots/maps except for 
> > > those geomaps. Could any one please hint me what/where could be 
> > > the problem? Many thanks for the idea and support.
>
>
> I had never used this until yesterday but it seems to generate html.
> I didn't manage to get a chart to display but if you are familiar with

> this package and html perhaps you could look at map1$html and see if 
> anything is obvious. One great thing about html/js is that it is human

> readable and you can integrate it well with other page material 
> without much in the way of special tools.
>
>
>
>
>
>
>
>
> > >
> > > Regards,
> > >
> > > SNV Krishna
> > >
> > > [[alternative HTML version deleted]]
> > >
> > >
> >
> > Hi All,
> >
> > I have also encountered this problem. I have tested the problem in 
> > Windows XP
>
> 3.0. I
> > have latest java and flash and I have tried both Firefox and IE 
> > (both latest
>
> k just
> > fine.
> >
> > I too would like to know how to solve this problem.
> >
> > Kind regards,
> >
> > Michael Phipps
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> **********************************************************************
> The information in this E-Mail and in any attachments is CONFIDENTIAL
and may be privileged.
> If you are NOT the intended recipient, please destroy this message and
notify the sender immediately.
> You should NOT retain, copy or use this E-mail for any purpose, nor 
> disclose all or any part of its contents to any other person or
persons.
>
> Any views expressed in this message are those of the individual 
> sender, EXCEPT where the sender specifically states them to be the
views of Lloyd's.
>
> Lloyd's may monitor the content of E-mails sent and received via its 
> network for viruses or unauthorised use and for other lawful business
purposes.
>
> Lloyd's is authorised under the Financial Services and Markets Act 
> 2000
> **********************************************************************
>
>
 		 	   		  
**********************************************************************
The information in this E-Mail and in any attachments is...{{dropped:27}}



More information about the R-help mailing list