sapply(df, c)
M=sapply(df, c)
head(M)
head(t(M))
head(t(M),100)
summary(t(M))
unlist(df)
d=summary(t(M))
d=unlist(df)
head(d)
d=unlist(df,F)
head(d)
example(gvisLineChart)
library(googleVIs)
library(googleVis)
example(gvisLineChart)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df)#
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, yvar=c("val1"))#
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, yvar=c("val1", "val2"))#
plot(Line)
library(googleVis)
?gvisLineChart
library(googleVis)
?gvisLineChart
library(googleVis)
?gvisLineChart
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"))
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Arial',fontSize:12'}"))
plot(Line)
Line
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Arial',fontSize:12}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", backgroundColor="grey"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", backgroundColor="grey", hAxis.textStyle="{color='white'}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", backgroundColor="grey", hAxis.textStyle="{color:'white'}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", backgroundColor="grey", hAxis.textStyle="{color:'white', fontName:'Arial', fontSize:10}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", curve='function'))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", curveType='function'))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", curveType='function'))
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(chartAread="{left:20,top:0,width:\"50%\",height:\"75%\"}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(chartAread="{left:20,top:0,width:\"50%\",height:\"50%\"}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(chartArea="{left:20,top:0,width:\"50%\",height:\"50%\"}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format='#,###%'))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="format:'#,###%'"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format='#,###%'))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="#,###%"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="{#,###%}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="#,###%"))
Line
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", format="#,###%"))
Line
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="{format:'#,###%'}"))
Line
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="{format:'#,###%'}"))
plot(Line)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", vAxis.format="{format:'#,###%'}"))
plot(Line)
print(Line, file="~/Desktop/Line.html")
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(title="Hello World", titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}", curveType='function'))
Line
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df, xvar="country", yvar=c("val1", "val2"), options=list(vAxis="{format:'#,###%'}"))
plot(Line)
library(googleVis)
example(gvisLineChart)
?gvisLineChart
library(googleVis)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Bar1 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Bar1)#
#
#
## Add a customised title and smoothed curve#
Bar2 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Bar2)#
#
\dontrun{#
## Change y-axis to percentages#
Bar3 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
                       options=list(vAxis="{format:'#,###\%'}"))#
plot(Bar3)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Bar1 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Bar1)#
#
#
## Add a customised title and smoothed curve#
Bar2 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Bar2)#
#
\dontrun{#
## Change y-axis to percentages#
Bar3 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
                       options=list(vAxis="{format:'#,###%'}"))#
plot(Bar3)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Bar1 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Bar1)#
#
#
## Add a customised title and smoothed curve#
Bar2 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Bar2)#
#
#
## Change y-axis to percentages#
Bar3 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2"),#
                       options=list(hAxis="{format:'#,###%'}"))#
plot(Bar3)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Col1 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Col1)#
#
#
## Add a customised title and smoothed curve#
Col2 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Bar2)#
#
\dontrun{#
## Change y-axis to percentages#
Col3 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"),#
                       options=list(vAxis="{format:'#,###\%'}"))#
plot(Col3)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Col1 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Col1)#
#
#
## Add a customised title and smoothed curve#
Col2 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Bar2)#
#
## Change y-axis to percentages#
Col3 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"),#
                       options=list(vAxis="{format:'#,###%'}"))#
plot(Col3)
#
## Stacked column chart#
Col2 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2")#
     options=list(isStacked=TRUE))#
plot(Col2)
#
## Stacked column chart#
Col2 <- gvisColumnChart(df, xvar="country", yvar=c("val1", "val2"),#
     options=list(isStacked=TRUE))#
plot(Col2)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Area chart#
Area1 <- gvisAreaChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Area1)#
#
## Stacked chart#
Area2 <- gvisAreaChart(df, xvar="country", yvar=c("val1", "val2"),#
      options=list(is.stacked=TRUE))#
plot(Area2)#
#
#
## Add a customised title and smoothed curve#
Area3 <- gvisAreaChart(df, xvar="country", yvar=c("val1", "val2"),#
             options=list(title="Hello World",#
                          titleTextStyle="{color:'red',fontName:'Courier',fontSize:16}",#
                          curveType='function'))#
plot(Area3)
## Stacked chart#
Area2 <- gvisAreaChart(df, xvar="country", yvar=c("val1", "val2"),#
      options=list(isStacked=TRUE))#
plot(Area2)
#
## Scatter chart#
Scatter1 <- gvisScatterChart(df, xvar="country", yvar=c("val1", "val2"))#
plot(Scatter1)
#
## Scatter chart#
Scatter1 <- gvisScatterChart(cars)#
plot(Scatter1)
library(MASS)
Isnurance
Insurance
women
Scatter1 <- gvisScatterChart(women)#
plot(Scatter1)
#
## Optional arguments#
Scatter2 <- plot(gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0, hAxis.title="weight",#
                 title="Women", vAxis="{title:'height'}", hAxis="{title:#
                'weight'}")#
                 ))#
#
plot(Scatter2)
library(googleVis)
?gvisGeoMap
G1 <- gvisGeoMap(Exports, locationvar='Country', numvar='Profit',#
                 options=list(dataMode="regions"))
plot(G1)
G1 <- gvisGeoChart(Exports, locationvar='Country', numvar='Profit',#
                 options=list(dataMode="regions"))
plot(G1)
library(XML)#
## Get earthquake data of the last 30 days#
eq=readHTMLTable("http://www.iris.edu/seismon/last30.html")#
eq <- eq[[2]] ## extract the eq table#
eq$loc=paste(eq$LAT, eq$LON, sep=":") ## create a lat:long location variable#
plot(gvisGeoMap(eq, "loc", "MAG","DATE"))
library(XML)#
## Get earthquake data of the last 30 days#
eq=readHTMLTable("http://www.iris.edu/seismon/last30.html")#
eq <- eq[[2]] ## extract the eq table#
eq$loc=paste(eq$LAT, eq$LON, sep=":") ## create a lat:long location variable#
plot(gvisGeoChart(eq, "loc", "MAG","DATE"))
gvisPieChart
#
Pie1 <- gvisPieChart(CityPopularity)#
plot(Pie1)
CityPopularity
## Gauge#
Gauge <-  gvisGauge(CityPopularity, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
## Gauge#
Gauge <-  gvisGauge(df, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
df
cars
## Gauge#
Gauge <-  gvisGauge(cars, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
## Gauge#
Gauge <-  gvisGauge(women, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
Population
Exports
Fruits
iris
## Gauge#
Gauge <-  gvisGauge(iris, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
## Gauge#
Gauge <-  gvisGauge(women[1:4,], options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
## Gauge#
Gauge <-  gvisGauge(women[1:4,1], options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
## Gauge#
Gauge <-  gvisGauge(women[1:4,], options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
CityPopularity
t(CityPopularity)
t(CityPopularity)[2,]
t(CityPopularity[,2])
x=t(CityPopularity[,2])
as.data.frame(X)
as.data.frame(x)
x=as.data.frame(x)
names(x)=CityPopularity[,1]
## Gauge#
Gauge <-  gvisGauge(x, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
plot(Gauge)
#
Gauge1 <- gvisGauge(CityPopularity, options=list(min=0, max=800, greenFrom=500,#
                    greenTo=800, yellowFrom=300, yellowTo=500,#
                    redFrom=0, redTo=300))#
#
plot(Gauge1)
library(googleVis)
?gvisGaugeChart
?gvisLineChart
library(timeseries)
library(quantmode)
install.packages(quantmode)
install.packages('quantmode')
library(tseries)
x=get.hist.quote("IBM")
head(x)
plot(x)
x
x=get.hist.quote("AAPL")
plot(x)
x=rnorm(10)
x
x=rnorm(1000)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))
Intensity <- gvisIntensityMap(df)#
plot(Intensity)
library(googleVis)
Intensity <- gvisIntensityMap(df)#
plot(Intensity)
Intensity1 <- gvisIntensityMap(df,#
              options=list(colors="['#4682b4', '#0073CF']"))#
plot(Intensity1)
#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
Intensity1 <- gvisIntensityMap(df)#
plot(Intensity1)
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
Intensity1 <- gvisIntensityMap(df, locationvar="country", numvar=c("val1", "val2"))#
plot(Intensity1)
Regions#
Org1 <- gvisOrgChart(Regions, options=list(width=600, height=400,#
                               size='large', allowCollapse=TRUE))#
plot(Org1)
#
Org1 <- gvisOrgChart(Regions)#
plot(Org1)
## Scatter chart#
Scatter <-  gvisScatterChart(women, options=list(legend="none", lineWidth=2,#
                                      pointSize=7, hAxis.title="weight", title="Women",#
                                      vAxis="{title:'height'}", hAxis="{title: 'weight'}"))
plot(Scatter)
cars
women
datasets::
AirPassengers
plot(gvisScatterChart(AirPassengers))
plot(gvisScatterChart(as.data.frame(AirPassengers)))
as.data.frame(AirPassengers)
head(as.data.frame(AirPassengers))
as.list(AirPassengers)
as.matrix(AirPassengers)
Nile
OrchardSprays
USAccDeaths
USArrests
plot(gvisScatterChart(USArrests))
plot(gvisLineChart(USArrests))
plot(gvisBarChart(USArrests))
df=USArrests
df$States <- rownames(USArrests)
head(df)
df=df[,5:1]
head(df)
plot(gvisBarChart(df), option=list(height=800))
plot(gvisBarChart(df), option=list(height=800))
plot(gvisBarChart(df, option=list(height=800))
)
plot(gvisBarChart(df, option=list(height=1000)))
plot(gvisLineChart(df, option=list(height=1000)))
plot(gvisLineChart(df, option=list(width=1000)))
lynx
plot(lynx)
?lynx
quakes
head(quakes)
trees
plot(gvisLineChart(trees))
#
## Scatter chart#
Scatter <-  gvisScatterChart(trees, options=list(legend="none", lineWidth=2,#
                                      pointSize=7, title="Trees data set",#
                                      vAxis="{title:'Height/Volume'}", hAxis="{title: 'weight'}"))#
plot(Scatter)#
pause()
?trees
Scatter <-  gvisScatterChart(trees, options=list(legend="none", lineWidth=2,#
                                      pointSize=7, title="Trees data set",#
                                      vAxis="{title:'ft (height), ft^3 (Volume)'}", hAxis="{title: 'Girth'}"))#
plot(Scatter)
#
## Scatter chart#
Scatter <-  gvisScatterChart(trees, options=list(legend="none", lineWidth=2,#
                                      pointSize=7, title="Data set: Trees",#
                                      vAxis="{title:'height: feet, volume: cubic feet'}", hAxis="{title: 'Girth'}"))#
plot(Scatter)
Scatter <-  gvisScatterChart(trees, options=list(lineWidth=2,#
                                      pointSize=7, title="Data set: Trees",#
                                      vAxis="{title:'Height: feet, Volume: cubic feet'}", hAxis="{title: 'Girth'}"))#
plot(Scatter)
Scatter <-  gvisScatterChart(trees, options=list(lineWidth=2,#
                                      title="Data set: Trees",#
                                      vAxis="{title:'Height: feet, Volume: cubic feet'}", hAxis="{title: 'Girth'}"))#
plot(Scatter)
Scatter <-  gvisScatterChart(trees, options=list(lineWidth=1,#
                                      title="Data set: Trees",#
                                      vAxis="{title:'Height: feet, Volume: cubic feet'}", hAxis="{title: 'Girth'}"))#
plot(Scatter)
plot(gvisLineChart(trees))
df=data.frame(x=sin(1:100/3), y=cos(1:100/3))
plot(gvisScatterChart(df))
df=data.frame(x=sin(1:100/3), y=cos(1:100/3), z=cos(1:100/3)*0.5)
plot(gvisScatterChart(df))
plot(gvisScatterChart(df))
?gvisScatterChart
plot(gvisScatterChart(df, options=list(curveType='function')))
plot(gvisScatterChart(df, options=list(curveType='function', pointSize=0)))
plot(gvisScatterChart(df, options=list(curveType='function', pointSize=1)))
plot(gvisScatterChart(df, options=list(curveType='function', pointSize=1, lineWidth=2)))
plot(gvisScatterChart(df, options=list(curveType='function', pointSize=0, lineWidth=2)))
#
df=data.frame(x=sin(1:100/3), #
              y=cos(1:100/3), #
 	      z=cos(1:100/3)*0.5)#
#
## Plot several variables as smooth curve#
Scatter3 <- gvisScatterChart(df, #
	    		options=list(curveType='function', #
				     pointSize=0, #
				     lineWidth=2))#
			)#
plot(Scatter3)
Scatter3 <- gvisScatterChart(df, #
	    		options=list(curveType='function', #
				     pointSize=0, #
				     lineWidth=2))#
plot(Scatter3)
#
df=data.frame(x=sin(1:100/3), #
              Circle=cos(1:100/3), #
 	      Ellipse=cos(1:100/3)*0.5)#
#
## Plot several variables as smooth curve#
Scatter3 <- gvisScatterChart(df, #
	    		options=list(curveType='function', #
				     pointSize=0, #
				     lineWidth=2))#
plot(Scatter3)
Scatter3 <- gvisScatterChart(df, #
	    		options=list(#curveType='function', #
				     pointSize=0, #
				     lineWidth=2))#
plot(Scatter3)
presidents
class(presidents)
data.frame(presidents)
class(presidents)
presidents
Stock
housing
library(MASS)
housing
hills
ships
plot(gvisLineChart(ships))
plot(gvisLineChart(ships[,-4]))
snails
steam
plot(gvisLineChart(steam))
plot(gvisScatterChart(steam))
Exports
CityPopularity
plot(gvisBarChart(CityPopularity))
plot(gvisColumnChart(CityPopularity))
setwd("~/Dropbox/google-motion-charts-with-r/inst/gadgets/")
## Sample data#
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))#
#
## Line chart#
Line <- gvisLineChart(df)#
cat(createGoogleGadget(Line), file="linechart.xml")#
#
#
## Bar chart#
Bar <- gvisBarChart(df)#
cat(createGoogleGadget(Bar), file="barchart.xml")#
#
## Column chart#
Column <- gvisColumnChart(df)#
cat(createGoogleGadget(Column), file="columnchart.xml")#
#
## Area chart#
Area <- gvisAreaChart(df)#
cat(createGoogleGadget(Area), file="areachart.xml")#
#
## Scatter chart#
Scatter <- gvisScatterChart(women, options=list(legend="none",#
                 lineWidth=2, pointSize=0, hAxis.title="weight",#
                 title="Women", vAxis="{title:'height'}",#
                 hAxis="{title:'weight'}")#
                 )#
cat(createGoogleGadget(Scatter), file="scatterchart.xml")#
#
## Pie chart#
Pie <- gvisPieChart(CityPopularity)#
cat(createGoogleGadget(Pie), file="piechart.xml")#
#
## Gauge#
Gauge <-  gvisGauge(CityPopularity, options=list(min=0, max=800, greenFrom=500,#
                                      greenTo=800, yellowFrom=300, yellowTo=500,#
                                      redFrom=0, redTo=300))#
cat(createGoogleGadget(Gauge), file="gauge.xml")#
#
## Intensity Map#
Intensity <- gvisIntensityMap(df)#
cat(createGoogleGadget(Intensity), file="intensitymap.xml")#
#
## Org chart#
Org <- gvisOrgChart(Regions, options=list(width=600, height=400,#
                               size='large', allowCollapse=TRUE))#
cat(createGoogleGadget(Org), file="orgchart.xml")
#
Pie1 <- gvisPieChart(CityPopularity)#
plot(Pie1)
Pie1$type
