library(tidyr)
## Warning: package 'tidyr' was built under R version 3.2.4
population<-read.csv("https://raw.githubusercontent.com/RobertSellers/crime_and_weather_study/master/data/Export/crimeANDweather_v1.csv", sep=",",na.strings = "NA",header = TRUE,stringsAsFactors = FALSE)
head(population,3)
## X city state year lat long airportID meanMaxF crimeRate
## 1 1 Abilene TX 1985 32.44874 -99.73314 ABI 42.36712 355
## 2 2 Abilene TX 1986 32.44874 -99.73314 ABI 44.86849 859
## 3 3 Abilene TX 1987 32.44874 -99.73314 ABI 44.67397 890
library(plotly)
## Warning: package 'plotly' was built under R version 3.2.4
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.4
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:graphics':
##
## layout
population<- subset(population,population$city=='Akron City' & population$year >2005)
plot_ly(population, x = year, y = crimeRate, size = crimeRate,color = meanMaxF,opacity = meanMaxF, mode = "markers")
#tidy<-subset(tidy,tidy$city=='New' & tidy$State=='NY')
library(plotly)
plot_ly(tidy, x = Year, y = city, size = crimeRate,color = temp,opacity = size, mode = "markers")
library(plotly)
p <- plot_ly(
x = tidy$Year,
y = tidy$temp,
name = "SF Zoo",
type = "bar",
color= tidy$Count
)
p