Skip to content
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

mask and letterCloud silently fail #12

Open
csteacherd22 opened this issue Dec 10, 2016 · 33 comments
Open

mask and letterCloud silently fail #12

csteacherd22 opened this issue Dec 10, 2016 · 33 comments

Comments

@csteacherd22
Copy link

Hello,
I'm enjoying wordcloud2 and hoping to make use of the unique features.
However, the png mask and letterCloud functions have been silently failing.
Also, using the provided example of setting figPath to a png fails as per https://rstudio-pubs-static.s3.amazonaws.com/187645_426d719fae56457f84d767fd6f076a43.html:

figPath = system.file("examples/t.png",package = "wordcloud2")
wordcloud2(demoFreq, figPath = figPath, size = 1.5,color = "skyblue")

Similarly, the "https://www.r-bloggers.com/the-wordcloud2-library/" Peace symbol example command: wordcloud2(demoFreq, figPath = "peace.png", size = 1.5, color = "skyblue", backgroundColor="black")
also silently fails.

@Lchiffon
Copy link
Owner

This is a small bug I haven't fix so far.

Have you tried to refresh the viewer or open in the browser?

image

@luke-a
Copy link

luke-a commented Dec 12, 2016

Same problem here. Refreshing helps - thanks!

@PS80
Copy link

PS80 commented May 1, 2017

Sorry Lchiffon, I experience the same issue in Google Chrome (even after reloading the page)... but the code works in IE

@zpurcey
Copy link

zpurcey commented May 24, 2017

I'm using the library to produce png's as a backend service and getting no output for letterCloud and mask generations.

Thanks for the great feature set, would help out if I was more of an R expert, will watch this bug for now.

@VeloSteve
Copy link

Mostly a "me too" in February 2018: using the latest R 3.4.3 and RStudio 1.1.419 I get the background image for either letterCloud() or the figPath option of wordcloud2. There are never any words, whether I reload or not. Sending it to Chrome gives just a blank white screen, not even the background.

@Kumpelka
Copy link

Kumpelka commented Feb 8, 2018

I face the same problems after installing the latest version of R 3.4.3 and RStudio 1.1.423 (I have updated all packages also). I get only the background of the letter (letterCloud function) or of the mask (wordcloud2 function with figPath option).

It worked on my old version of R, RStudio and packages but unfortunately it did not save the configuration reference. Maybe someone know if there is a configuration who works ?

@SarahDawsonStats
Copy link

SarahDawsonStats commented Feb 23, 2018

I'm having the same problem, letterCloud is producing only the background "word" in black, with none of the actual words from the data frame showing. I've tried several different versions of R to no avail.

letterCloud(demoFreq,"R")

image

However, if I re-install the package directly from git rather than cran, it works!

library(devtools)
devtools::install_github("lchiffon/wordcloud2")
letterCloud(demoFreq,"R")

image

@bemeyer
Copy link

bemeyer commented Mar 23, 2018

Same issue here. "wordcloud2" produces a nice image in RStudio that is viewable in markdown and in an html doc after it is knit, but not viewable in a browser (Chrome or Firefox). All packages updated, RStudio 1.1.442, R version 3.4.4 (2018-03-15)

Here's the doc with an invisible image: http://rpubs.com/bmeyer/372805, Session info included within.

@AsterAlpestris
Copy link

I could manage to make it work in Rstudio after installing the package via github as suggested by SarahDawsonStats, but it needs everytime a refresh.
Unfortunately it seems not working in a Shiny application.

@MayoIsLife
Copy link

Hi all, I ran into the same issue but unfortunately I did not manage to resolve it with SarahDawsonStats' suggestion of downloading the source package. When I reinstall it, I instead get the following error running any type of wordcloud2 output:

Error in yaml.load(readLines(con), error.label = error.label, ...) : argument "error.label" is missing, with no default

Things I have tried so far:

  • Install all of the Windows binaries from from the wordcloud2 CRAN page (only the r-release version will work as intended, save for the image/letter mask functionalities. The other 2 will lead to the error above)
  • Use alternative sources to install the package
  • Perform various fresh installs of the yaml package
  • Googled extensively to find solutions to the error mentioned above but to no avail, and most seemed to stem from unrelated issues
  • Tried to open the image/letter mask in a browser (as per the author's suggestion). Tried in Chrome, Firefox and IE.
  • A fresh install of RStudio + deleting all packages and reinstalling only the bare minimum
  • All of the above I tried both with the provided sample dataset (demoFreq) as well as my own textual dataset.

Any help would be greatly appreciated, I'm not sure where I'm going wrong!

@nateofspades
Copy link

I had the same problem with nothing displaying from wordcloud2 when I added the figPath argument. Once I changed my default browser from Chrome to IE (and allowed "blocked content") it worked:

wordcloud2(demoFreq, figPath="logo.jpg")

@HannahChi1628
Copy link

HannahChi1628 commented Jul 27, 2018

Sorry, I meet the same problem with MayoIsLife.
I did not manage to resolve it by downloading the source package from github.

When installed the package from CRAN, it will show only background.
If installed the package from github, it will silently failed.

Could anyone help me to solve the issue? I really enjoying using this package.

@Nelson-Gon
Copy link

LetterCloud only returns the word and not the dataset.

@jiristo
Copy link

jiristo commented Feb 24, 2019

Do not use system.file()

I did this and it works:

figPath <- "/Users/jiristodulka/R/web_scraping/reddit_cannabis/canna_leaf.png"

wordcloud2(demoFreq, figPath = figPath, size = 3,color = "green", backgroundColor = "black")

@stragu
Copy link

stragu commented Apr 7, 2019

Hi all

Just an update on this: same issue here with CRAN (0.2.1) and GitHub (0.2.2) packages: using a PNG mask, or using letterCloud(), I don't get anything, just the background colour, even after refreshing or opening the external viewer (in Firefox).

The code I used (with a couple of different PNG files):

wordcloud2(demoFreq,
           figPath = "t.png",
           color = "skyblue",
           backgroundColor = "pink")
letterCloud(demoFreq,
            word = "R",
            color = "skyblue",
            backgroundColor = "pink")

However, the shape argument does work fine:

wordcloud2(demoFreq,
           shape = "star",
           size = 1.5,
           color = "skyblue",
           backgroundColor = "pink")

My system details:

  • R 3.5.3
  • RStudio 1.1.463, with:
    • Mozilla/5.0 (X11; N; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) RStudio Safari/538.1 Qt/5.4.2
  • Ubuntu 18.04

@Ravimoon25
Copy link

Hi Everyone,

I faced the similar issues too. However, I've reinstalled wordcloud2 from dev tools and it worked.

devtools::install_github("lchiffon/wordcloud2")

@Tranquilsun
Copy link

Hello, I am a new learner in R programming. I am faced with a problem that I can not install the package wordcloud2 via command " devtools::install_github("lchiffon/wordcloud2") " , befor which, I have successfully installed install.packages('devtools').
The error is shown as the attached screenshot.

Thanks for your reply.
error_install_wordcloud2

@stragu
Copy link

stragu commented Jul 9, 2019

@Tranquilsun your question is not related to this particular issue, so you will have to open a new issue. However, I suspect your problem is not related to the wordcloud2 package. I'd recommend to first try and reinstall it after restarting your R session, and if that fails, look online for an existing solution somewhere as other people have asked similar questions before (for example here). But we should stop discussing your particular issue here as it is not related to this ticket. Good luck!

@cyarrison1
Copy link

Any resolution here? I installed the package directly from github, which worked once and then I couldn't get it to work again, trying various combinations of refreshing and browser changes. Thank you!

@data2030
Copy link

@cyarrison1 try to change the size. I had this problem yesterday and solved it by increasing the size from size= 1.5 to size= 5.

@j-tamad
Copy link

j-tamad commented Feb 20, 2020

How do you get that font? I've tried a few others, but always get the default ''Segoe UI'

@Galfo92
Copy link

Galfo92 commented Oct 13, 2020

Not a solution but maybe can help someone:
I made some test and here some tips:

  1. use widgetsize = c(x, y), where:
  • x is a multiple of the horizontal resolution (in pixels) of the image used as a mask
  • y is a multiple of the vertical resolution (in pixels) of the image used as a mask
  1. always click (1x) refresh the viewer or open in the browser (+ 1x refresh)

  2. (Bad but better as nothing) if still notworking (as desired) rescale your freq variable to smaller value (ex. with scales::rescales(x, to = c(1,7)) and run another time

-> Open in browser and save with ctrl + p

@olferievm
Copy link

Not a solution but maybe can help someone:
I made some test and here some tips:

  1. use widgetsize = c(x, y), where:
  • x is a multiple of the horizontal resolution (in pixels) of the image used as a mask
  • y is a multiple of the vertical resolution (in pixels) of the image used as a mask
  1. always click (1x) refresh the viewer or open in the browser (+ 1x refresh)
  2. (Bad but better as nothing) if still notworking (as desired) rescale your freq variable to smaller value (ex. with scales::rescales(x, to = c(1,7)) and run another time

-> Open in browser and save with ctrl + p

Unfortunately it is not.

@jeffcsauer
Copy link

jeffcsauer commented Jan 4, 2021

For those facing this issue, it seems you must provide both a color argument as well as a backgroundColor argument. You may also need to refresh the RStudio image preview window to get the graphic to load.

@rafabelokurows
Copy link

I was struggling with this issue for a few hours but managed to make it work by installing the Github version of the package AND by refreshing the RStudio Viewer Pane EVERY TIME I generate a word cloud with a mask. For now, it's enough. Thanks for the instructions!

@Cruisecoder
Copy link

I had the same problem with nothing displaying from wordcloud2 when I added the figPath argument. Once I changed my default browser from Chrome to IE (and allowed "blocked content") it worked:

wordcloud2(demoFreq, figPath="logo.jpg")

It did not work for me, I have stuck with this problem for 3 hours, maybe I should skip this ... This package does have bugs..

@birasafab
Copy link

after trying all the suggestions provided above I still have issues of figure masking in wordcloud2 till now. any support to overcome this will be highly appreciated!

@frarzo
Copy link

frarzo commented May 21, 2022

I'm also experiencing the same problem, getting a blank output when creating a wordcloud using a mask.
Tried different things:

  • CRAN / Github package
  • figPath<-system.file("path",package="wordcloud2") /figPath <- "Globalpath"

But in the end I always get a blank output or the very png I used as mask after computing a couple times.

@stepminer
Copy link

I have the same issue even after re-installing from the Github development version.

Is there anybody Home?

@akhtarali007
Copy link

  1. widgetsize = c(x, y)
    it did not work

@RickyEsclapon
Copy link

Same here 🥲

@SaraSchiesberg
Copy link

none of the suggested solutions works for me ...

@azanghai
Copy link

I waited a few minutes, then kept hitting the refresh button in the viewer like crazy, and it finally worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests