ScientiaFelis/sebmsR

abundance_year_compare does not save

Closed this issue · 18 comments

when using this for 2021:2022, it displays a correct image but throws an error instead of saving the graph
image

Cannot reproduce error!?

Not sure how to fix the win10 error. Do you have any idea of what is causing it?

The font error perhaps could be fixed by having Arial installed, which it should be, then import it in R with:

extrafont::font_import()

And perhaps

extrafont::loadfonts(device = "pdf", quiet = TRUE)
extrafont::loadfonts(device = "postscript", quiet = TRUE)
extrafont::loadfonts(device = "win", quiet = TRUE)

It didn't throw the font error messages now but I believe that was because I ran sebms_species_per_sitetype_plot(year=2022) first and got the errors (of the session) there. Or - maybe not. I restarted R now and ran sebms_abundance_year_compare_plot(year = 2021:2022) but didn't get any font errors. The fonts look ok too (which they don't in the sebms_species_per_sitetype_plot() .

However, on my windows machine, it writes an empty "Butterflynumber_2021" (0kB) with no suffix. I think my Mac did write a proper graph yesterday.

Unlikely that the save fail is a mac thing. I tried testing on my laptop now but Box Sync with my R files isn't up to date so that will take a while, But it is more likely that there is a bug in that function and that I was wrong when I thought I saw it being created on my mac at home ping @ScientiaFelis

Ok, that is odd.
I will see if I can figure out what is wrong

It saved nicely on a mac but fails on a PC, still making a 0 kB file with no suffix. The built png cuts the top Y axis value (18000) so needs to be fixed.

There is something funny about the week numbers too. compare these two, one from the last report and one from the package
sebmsr20-21
report-20-21

I think that the empty file actually can result from missing fonts.

I will check the weeks, seems to be one week off to the right?

Is this still failing @larspett ?

No font error thrown bit does not save

The errors are still there, 11 + 18 of them

There were 11 warnings (use warnings() to see them)

warnings()
Warning messages:
1: In grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
font family not found in Windows font database
2: In grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
font family not found in Windows font database
3: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
4: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
5: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
6: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
7: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
8: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
9: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
10: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
11: In grid.Call.graphics(C_text, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
There were 18 warnings (use warnings() to see them)
warnings()
Warning messages:
1: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
2: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
3: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
4: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
5: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
6: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
7: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
8: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
9: In grid.Call.graphics(C_text, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
10: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
11: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
12: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
13: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
14: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
15: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
16: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
17: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database
18: In grid.Call.graphics(C_text, as.graphicsAnnot(x$label), ... :
font family not found in Windows font database

and the png is still 0 kB

I think it is fixed in the latest push.
I had forgot a bugtracer in the code. Strange that it worked at all

Butterflynumber is still 0 kB in latest version (1.4.7)

I cannot see why.
It is still a Windows problem right?

Replace : to - in file names
Windows should be able to handle it now.