According to this post it seems like I should just be able to to put the variable name holding the plot into the ggplotly function and then the graph should have mouseover points. The data points do not display anything when I scroll the mouse over in adobe reader nothing displays. I would like to be able to write my own custom labels for each point.
install.packages(c("devtools"))
library(devtools)
dev_mode(on=T)
install_github("hadley/ggplot2")
install.packages(c("ggplot2"))
library(ggplot2)
install.packages(c("plotly")) #Select mirror ("USA (WA)")
library("plotly")
install.packages(c("Cairo"))
library("Cairo")
all_rates = read.csv("file.txt")
for(i in unique(gsub('_[0-9]+', '', all_rates[,1]))){
rates <- all_rates[grep(i, all_rates[,1]),]
freq = unlist(rates[2])
temp = unlist(rates[3])
exn = unlist(rates[4])
p = ggplot(rates, aes(freq,temp)) + geom_point(data=rates, aes(freq,temp,group=factor(exn),colour=factor(exn))) + geom_smooth(data=rates, aes(freq,temp,group=factor(exn),colour=factor(exn)),method = "lm",fill=NA)
ggplotly(p)
ggsave(paste0(i, ".pdf"))
}
I still get
We recommend that you use the dev version of ggplot2 with `ggplotly()`
Install it with: `devtools::install_github('hadley/ggplot2')`
As a warning. I was under the impression that I was using this version though based on this post
This is the output I get after all the checks and creates for the packages
The downloaded source packages are in
'/tmp/Rtmpo0GRLE/downloaded_packages'
We recommend that you use the dev version of ggplot2 with `ggplotly()`
Install it with: `devtools::install_github('hadley/ggplot2')`
Saving 7 x 7 in image
We recommend that you use the dev version of ggplot2 with `ggplotly()`
Install it with: `devtools::install_github('hadley/ggplot2')`
Saving 7 x 7 in image
file.txt
clothing,freq,temp,exn
coat_1,0.3,10,1
coat_1,0.9,0,1
coat_1,0.1,20,1
coat_2,0.5,20,2
coat_2,0.3,15,2
coat_2,0.1,5,2
scarf,0.4,30,1
scarf,0.2,20,1
scarf,0.1,10,1