-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Description
Trying to make a plot with geom_smooth() ends up without the smoothing layer. The error message is
In layer2traces(L, df, misc): Conversion not implemented for geom_smooth (basic geom_smooth),
ignoring. Please open an issue with your example code at https://github.com/ropensci/plotly/issues
Code to reproduce is as follows
raw_data = Quandl(c('WIKI/XOM', "NSE/OIL"))
clean.quandl.name <- function(x) {
cleaned <- x
if (x=='Date') {} else {
tryCatch({
parts <- stringr::str_split(x, " - ",n=2)
first.parts <- stringr::str_split(parts[[1]][[1]], "\\.",n=2)
cleaned <- paste(first.parts[[1]][[2]], parts[[1]][[2]], sep=".")
cleaned <- str_replace_all(cleaned," ","")
},
error = function(e) {cat(paste0("Err on",x,"\n"))}
)
}
stringr::str_trim(cleaned)
}
fixed.names <- lapply(names(raw_data),clean.quandl.name)
renamed_data <- raw_data
names(renamed_data) <- fixed.names
gp <- ggplot(renamed_data, aes(x=OIL.Open, y=XOM.Open))+geom_point()+geom_smooth()
py <- plotly()
response <- py$ggplotly(gp)
My output looked like this:
but should have looked like this:
Metadata
Metadata
Assignees
Labels
No labels