EESI / themetagenomics

Other
23 stars 4 forks source link

Warning: Error in as.character.factor: attempting to coerce non-factor #11

Closed tklammsteiner closed 4 years ago

tklammsteiner commented 4 years ago

Hello,

I tried to work through the "Finding Thematic Structure in the David Dataset" tutorial and simultaneously tested the workflow on my own data. The following error messages and issues all occured when using the David data and the thematic structure tutorial. I was using

R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Once I arrived at the visualization step...

vis(TOPIC_EFFECTS, type = 'taxa')

...I got a couple of error messages when the plotly window containing the figures opened:

Listening on http://127.0.0.1:6823
Warning: Error in as.character.factor: attempting to coerce non-factor
  [No stack trace available]
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  101: <Anonymous>
Warning: The 'plotly_click' event tied a source ID of 'ord_click' is not registered. In order to obtain this event data, please add `event_register(p, 'plotly_click')` to the plot (`p`) that you wish to obtain event data from.
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>

In addition there were several error messages within the plotly window ("Error: attempting to coerce non-factor") and only the plot showing the barchart was visible. If I tried to visualize the date with e.g. "type = continuous" or one of the two other options, even the bar chart did not appear as a plot. I retried the analysis several times (e.g. after additionally installing the suggested packages, using the dev version of the themetagenomics package, etc.) The same goes for the visualization of functions with the command:

vis(FUNCTION_EFFECTS2,TOPIC_EFFECTS,ui_level=.95)

Again similar errors in the console:

Listening on http://127.0.0.1:6823
Warning: Error in as.character.factor: attempting to coerce non-factor
  [No stack trace available]
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: The 'plotly_click' event tied a source ID of 'hm_fxn' is not registered. In order to obtain this event data, please add `event_register(p, 'plotly_click')` to the plot (`p`) that you wish to obtain event data from.
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  [No stack trace available]
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in as.character.factor: attempting to coerce non-factor
  106: <Anonymous>
Warning: Error in proxy::dist: Can only handle data frames, vectors, matrices, and lists!
  [No stack trace available]

I researched the error messages and it seems that it has to do with some deeper problem in R when transforming S3 elements to S4, but my knowledge of R is not sufficient to provide solutions for that.

Did anybody else experience a similar issue? Would be glad if somebody could help!

sw1 commented 4 years ago

Sorry. I had to make an update for the upcoming R v4.0. It was a simple update but apparently broke the vis functions. I have since fixed it and it seems to be working again. I am resubmitting to CRAN but it might take a few days. In the meantime, you can try devtools::install_github('sw1/themetagenomics',build_vignettes=TRUE).

tklammsteiner commented 4 years ago

Hey, thanks for the quick reply! Great to hear that the issue has already been fixed.

I tried to install the package via the command you posted:

devtools::install_github('sw1/themetagenomics',build_vignettes=TRUE)

but unfortunately that did not work for me and the installation was terminated with some errors:

Error: (converted from warning) Paket 'Rcpp' was built under R Version 3.6.3
Execution stopped
ERROR: lazy loading failed for package 'themetagenomics'
* removing '.../R/win-library/3.6/themetagenomics'
* restoring previous '.../R/win-library/3.6/themetagenomics'
Error: Failed to install 'themetagenomics' from GitHub:
  (converted from warning) installation of package ‘.../AppData/Local/Temp/RtmpcTV4km/file10446a496e04/themetagenomics_1.0.2.tar.gz’ had non-zero exit status

I checked again if all the package versions etc. are up to date, but that did not change anything. So I will probably wait for the CRAN release and hope that I can get it to work

tklammsteiner commented 4 years ago

After installing the updated version and running your test data everything seems to work! Thanks a lot!

gailrosen commented 4 years ago

Wonderful! Thanks, Steve!


From: tklammsteiner notifications@github.com Sent: Wednesday, May 6, 2020 4:59 AM To: EESI/themetagenomics Cc: Subscribed Subject: Re: [EESI/themetagenomics] Warning: Error in as.character.factor: attempting to coerce non-factor (#11)

External.

After installing the updated version and running your test data everything seems to work! Thanks a lot!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEESI%2Fthemetagenomics%2Fissues%2F11%23issuecomment-624526140&data=02%7C01%7Cglr26%40drexel.edu%7C795ea94813ac4793029808d7f19bbe6e%7C3664e6fa47bd45a696708c4f080f8ca6%7C0%7C0%7C637243523535439100&sdata=%2Bp%2BS1%2BOsaAcq1YvVK14BcEdFEyEBT8%2BDPW9N%2BN3VlE0%3D&reserved=0, or unsubscribehttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABHZROLPUKZ5TPLG3FJI25DRQERF5ANCNFSM4MUCBQ7A&data=02%7C01%7Cglr26%40drexel.edu%7C795ea94813ac4793029808d7f19bbe6e%7C3664e6fa47bd45a696708c4f080f8ca6%7C0%7C0%7C637243523535449094&sdata=CIfYAihlbpyyYL29GSrcnHLayE%2BVYiLX6Rdlw%2FI9dWw%3D&reserved=0.