-
Notifications
You must be signed in to change notification settings - Fork 633
Namespace clash with NLP package #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting this issue. I have been able to replicate the same error on my Linux. I will try to debug today. |
@zippeurfou Hi! I tried your code on my Mac today and everything works. Are you still having the same problem? Here's the Plotly plot I made: And here's the list output from $data
$data[[1]]
$data[[1]]$x
[1] 1.561284 6.088862 9.978292 15.454877
$data[[1]]$y
[1] 0.2228790 0.8343259 -3.6507234 -4.8520206
$data[[1]]$text
[1] HUNTSVILLE MOBILE BIRMINGHAM MONTGOMERY
Levels: BIRMINGHAM HUNTSVILLE MOBILE MONTGOMERY PEORIA TUCSON
$data[[1]]$type
[1] "scatter"
$data[[1]]$mode
[1] "text"
$data[[1]]$textfont
$data[[1]]$textfont$color
[1] "#F8766D"
$data[[1]]$name
[1] "East South Central"
$data[[1]]$xaxis
[1] "x1"
$data[[1]]$yaxis
[1] "y1"
$data[[1]]$showlegend
[1] TRUE
$data[[2]]
$data[[2]]$x
[1] 23.225289 -7.283954
$data[[2]]$y
[1] -0.443865 9.125279
$data[[2]]$text
[1] TUCSON PEORIA
Levels: BIRMINGHAM HUNTSVILLE MOBILE MONTGOMERY PEORIA TUCSON
$data[[2]]$type
[1] "scatter"
$data[[2]]$mode
[1] "text"
$data[[2]]$textfont
$data[[2]]$textfont$color
[1] "#00BFC4"
$data[[2]]$name
[1] "Mountain"
$data[[2]]$xaxis
[1] "x1"
$data[[2]]$yaxis
[1] "y1"
$data[[2]]$showlegend
[1] TRUE
$layout
$layout$xaxis
$layout$xaxis$tickcolor
[1] "rgb(127,127,127)"
$layout$xaxis$gridcolor
[1] "rgb(255,255,255)"
$layout$xaxis$showgrid
[1] TRUE
$layout$xaxis$ticks
[1] "outside"
$layout$xaxis$showticklabels
[1] TRUE
$layout$xaxis$type
[1] "linear"
$layout$xaxis$title
[1] "coord.1"
$layout$xaxis$zeroline
[1] FALSE
$layout$xaxis$showline
[1] FALSE
$layout$yaxis
$layout$yaxis$tickcolor
[1] "rgb(127,127,127)"
$layout$yaxis$gridcolor
[1] "rgb(255,255,255)"
$layout$yaxis$showgrid
[1] TRUE
$layout$yaxis$ticks
[1] "outside"
$layout$yaxis$showticklabels
[1] TRUE
$layout$yaxis$type
[1] "linear"
$layout$yaxis$title
[1] "coord.2"
$layout$yaxis$zeroline
[1] FALSE
$layout$yaxis$showline
[1] FALSE
$layout$plot_bgcolor
[1] "rgb(229,229,229)"
$layout$margin
$layout$margin$r
[1] 10
$layout$legend
$layout$legend$bordercolor
[1] "transparent"
$layout$legend$x
[1] 1.05
$layout$legend$y
[1] 0.5
$layout$legend$xanchor
[1] "center"
$layout$legend$yanchor
[1] "top"
$layout$legend$font
$layout$legend$font$family
[1] ""
$layout$legend$bgcolor
[1] "rgb(255,255,255)"
$layout$showlegend
[1] TRUE
$layout$annotations
$layout$annotations[[1]]
$layout$annotations[[1]]$text
[1] "<b>Division</b>"
$layout$annotations[[1]]$x
[1] 1.05
$layout$annotations[[1]]$y
[1] 0.52
$layout$annotations[[1]]$showarrow
[1] FALSE
$layout$annotations[[1]]$xref
[1] "paper"
$layout$annotations[[1]]$yref
[1] "paper"
$layout$annotations[[1]]$xanchor
[1] "center"
$layout$annotations[[1]]$textangle
[1] 0
$layout$titlefont
$layout$titlefont$family
[1] ""
$layout$paper_bgcolor
[1] "rgb(255,255,255)" |
This is weird. I am still having the same issue after updating with
On Thu, Jun 25, 2015 at 2:28 PM, Baobao Zhang [email protected]
Marc Ferradou : www.marc.ferradou.fr [image: View my |
@zippeurfou I am sorry to hear that. You could try installing @cpsievert 's experimental branch: devtools::install_github("ropensci/plotly@carson-dsl") It worked for me. Let me know how it goes. |
Still not 😢
|
Hi @zippeurfou, could you include the output of |
|
Huh, strange, could you try running this example in a clean R session? That is, restart R (or start a new session) and run the example. If that doesn't work, let us know and report the |
It worked. It is still weird that it did not work before:
|
Thanks, glad to know that fixed it. The problem is caused by loading the NLP package, which changes the behavior of this line. Using > library(plotly)
Loading required package: ggplot2
Howdy, test_bot!
Sweet, you have an API key already!
Start making plots with ggplotly() or plot_ly().
Attaching package: ‘plotly’
The following object is masked from ‘package:graphics’:
layout
> mds <- data.frame(State=c("Alabama", "Alabama", "Alabama", "Alabama",
+ "Arizona", "Arizona"),
+ City=c("HUNTSVILLE", "MOBILE", "BIRMINGHAM", "MONTGOMERY",
+ "TUCSON", "PEORIA"),
+ coord.1=c(1.561284, 6.088862, 9.978292, 15.454877,
+ 23.225289, -7.283954),
+ coord.2=c(0.2228790, 0.8343259, -3.6507234, -4.8520206,
+ -0.4438650, 9.1252792),
+ Division=c("East South Central", "East South Central",
+ "East South Central", "East South Central",
+ "Mountain", "Mountain"))
> gg <- ggplot(mds) +
+ geom_text(aes(x=coord.1, y=coord.2, label=City, colour=Division))
>
> L <- gg2list(gg)
> library(NLP)
Attaching package: ‘NLP’
The following object is masked from ‘package:ggplot2’:
annotate
> L <- gg2list(gg)
Error in gg2list(gg) : object 'nann' not found |
I'll fix it. |
@13bzhang @cpsievert this error is now happening again. |
Fixed in 3d9a6b7 |
I still got this error. If I detach the NLP package, everything works fine. |
Any update on this? I'm not loading NLP, but another package that depends on it and it is messing with my plots. |
I'm also still having this problem. I think the only way to deal with this is figure out what other packages could cause problems, and either split your analysis into sections that use non-plotly compatible packages, do your analysis, unload those packages, then load plotly and ggplot and graph. |
This shouldn't be a problem anymore. Are you using the latest version of plotly? |
Hey guys, Here’s the code to unload the packages that worked for me: sess.pkgs <- function (package = NULL) lapply(paste("package:",sess.pkgs()$otherPkgs, sep=""), detach, Output of my ggplot for my data: Important to note:
Plotly output (screenshot): As you can see, not all settings were transferred. This may be because I am significantly less experienced with plotly than ggplot. My apologies for that. At least the alpha settings seem to be spot on. Anyways, thank you for getting back to me. I think there are still namespace collisions, but I currently do not know which package is causing the problem. I’m sure I’ll figure that out as soon as I start loading each package I need individually, then test to see if I can still make the plot. Once I find the offending package, I’ll get back to ya'll. It seems package parsimony is the best practice thus far. And just in case you’re interested, I attached the code and data used to build the graphs: Hope this helps. Again, thank you for getting back to me. Best,
|
Hi,
I am running mac os x
Is this the normal behavior?
The text was updated successfully, but these errors were encountered: