Problem with screenFoodWeb plotting

5 views
Skip to first unread message

Bruno Linhares

unread,
Aug 4, 2021, 4:01:24 PMAug 4
to claudio...@upla.cl, clqu...@harrodlab.net, trophicposi...@googlegroups.com
Dear Quezada-Romegialli,

I am currently exploring the tRophicPosition package, and while trying to use the screenFoodWeb function, I noticed that there is a problem in displaying the legend colours correctly when using the function... i.e. legends only appear in black.

You can see this issue when trying to run the example directly in the CRAN webpage: https://rdrr.io/cran/tRophicPosition/man/screenFoodWeb.html

Error message: 1: Use of `summary[[grouping[1]]]` is discouraged. Use `.data[[grouping[1]]]` instead. (...)

There seems to be a problem with ggplot in recognizing the grouping argument. As I am no expert in programming and having difficulties in fixing it, thought it could be helpful to contact you. If you have any solutions, please let me know. And thanks for this wonderful package!

Best regards,
Bruno de Andrade Linhares
MSc student - Universidade Federal do Rio Grande (Brazil)

Claudio Quezada Romegialli

unread,
Aug 4, 2021, 4:18:21 PMAug 4
to Bruno Linhares, Claudio Quezada R., tRophicPosition
Hi Bruno

Could you please share the exact code you are using with an example dataset please?

To my knowledge, this is related to ggplot instead of tRophicPosition, but I can take a look once I know the error/warning it gives you.

Cheers

Claudio

Bruno Linhares

unread,
Aug 4, 2021, 7:35:41 PMAug 4
to Claudio Quezada Romegialli, tRophicPosition
Hi Claudio, I appreciate your quick return.

The warning seems to be the same as it shows in the CRAN webpage, so it looks like the error is not related to the data. Nonetheless, I attached to this email a very short dataset (subset of mine) and the simple code I tried to use. I did not make much effort on customizing the code through the package, but rather tried to produce the plot directly through ggplot, which now returned a similar graphic (I also attached it to the code). 
Let me know if you have any news, and thanks in advance!

I adapted the ggplot code from your code for the screenFoodWeb and other code from Andrew Jackson:
https://github.com/clquezada/tRophicPosition/blob/master/R/screenFoodWeb.R

Cheers,

Bruno de Andrade Linhares
MSc student - Universidade Federal do Rio Grande (Brazil)
trophPositionscript.R
example_data.xlsx
Reply all
Reply to author
Forward
0 new messages