You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 sessionInfo() again.
The problem is caused by loading the NLP package, which changes the behavior of this line. Using exists() in this way is poor practice and should be fixed (feel free to start a PR if you like @13bzhang)
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.
Hey guys,
I sorta solved the problem...Restarting R didn’t help, some package was still causing problems. However, using the code pasted below to remove packages and then just loading the ggplot and plotyly libraries gave me a quasi solution. I put screen shots in showing the difference between ggplot and plotly’s output. That said, I was able to get plotly output after stripping all loaded packages, so I’ll count that as a little victory in and of itself. However, you’ll see some problems when I go from ggplot to plotly regarding the actual layout of my visualization. I think Plotly has opportunity to improve regarding the ability to honor legend placements, axis labels, title settings, etc. from ggplot.
red is always under the blue within each stack, if both failures and acceptable calculation times exist on the same date, this came from ordering the dataset with respect to date plus a given factor var (“Over25”)
legend placement is on bottom, I want this because horizontal real estate is at a premium whenever plotting time series observations
Title fits on output
x-axis labels are initialized close enough to my first observation to make the time scale more easily perceivable
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.
Activity
13bzhang commentedon Jun 23, 2015
Thanks for reporting this issue. I have been able to replicate the same error on my Linux. I will try to debug today.
13bzhang commentedon Jun 25, 2015
@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:
https://plot.ly/~13bzhang/963/coord2-vs-coord1/
And here's the list output from
gg2list:zippeurfou commentedon Jun 25, 2015
This is weird. I am still having the same issue after updating with
On Thu, Jun 25, 2015 at 2:28 PM, Baobao Zhang notifications@github.com
wrote:
Marc Ferradou : www.marc.ferradou.fr [image: View my
profile on LinkedIn]View my profile
http://www.linkedin.com/in/marcferradou
13bzhang commentedon Jun 25, 2015
@zippeurfou I am sorry to hear that. You could try installing @cpsievert 's experimental branch:
It worked for me. Let me know how it goes.
zippeurfou commentedon Jun 25, 2015
Still not 😢
cpsievert commentedon Jun 25, 2015
Hi @zippeurfou, could you include the output of
sessionInfo()?zippeurfou commentedon Jun 25, 2015
cpsievert commentedon Jun 25, 2015
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
sessionInfo()again.zippeurfou commentedon Jun 25, 2015
It worked. It is still weird that it did not work before:
cpsievert commentedon Jun 25, 2015
Thanks, glad to know that fixed it.
The problem is caused by loading the NLP package, which changes the behavior of this line. Using
exists()in this way is poor practice and should be fixed (feel free to start a PR if you like @13bzhang)[-]test-ggplot-text.R test colour not working on my computer[/-][+]Namespace clash with NLP package [/+]13bzhang commentedon Jun 25, 2015
I'll fix it.
zippeurfou commentedon Dec 3, 2015
@13bzhang @cpsievert this error is now happening again.
On the fix-ggplot branch the NLP package make it bug
cpsievert commentedon Dec 10, 2015
Fixed in 3d9a6b7
giocomai commentedon Jan 24, 2016
I still got this error. If I detach the NLP package, everything works fine.
xuxoramos commentedon Feb 12, 2016
Any update on this? I'm not loading NLP, but another package that depends on it and it is messing with my plots.
ngfrey commentedon May 9, 2016
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.
cpsievert commentedon May 9, 2016
This shouldn't be a problem anymore. Are you using the latest version of plotly?
ngfrey commentedon May 11, 2016
Hey guys,
I sorta solved the problem...Restarting R didn’t help, some package was still causing problems. However, using the code pasted below to remove packages and then just loading the ggplot and plotyly libraries gave me a quasi solution. I put screen shots in showing the difference between ggplot and plotly’s output. That said, I was able to get plotly output after stripping all loaded packages, so I’ll count that as a little victory in and of itself. However, you’ll see some problems when I go from ggplot to plotly regarding the actual layout of my visualization. I think Plotly has opportunity to improve regarding the ability to honor legend placements, axis labels, title settings, etc. from ggplot.
Here’s the code to unload the packages that worked for me:
From: http://stackoverflow.com/questions/7505547/detach-all-packages-while-working-in-r http://stackoverflow.com/questions/7505547/detach-all-packages-while-working-in-r
Specifically:
sess.pkgs <- function (package = NULL)
{ z <- list()
if (is.null(package)) {
package <- grep("^package:", search(), value = TRUE)
keep <- sapply(package, function(x) x == "package:base" ||
!is.null(attr(as.environment(x), "path")))
package <- sub("^package:", "", package[keep])
}
pkgDesc <- lapply(package, packageDescription)
if (length(package) == 0)
stop("no valid packages were specified")
basePkgs <- sapply(pkgDesc, function(x) !is.null(x$Priority) &&
x$Priority == "base")
z$basePkgs <- package[basePkgs]
if (any(!basePkgs)) {
z$otherPkgs <- package[!basePkgs]
}
z
}
lapply(paste("package:",sess.pkgs()$otherPkgs, sep=""), detach,
character.only = TRUE, unload = TRUE)
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,
NF