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

abundance_year_compare does not save #23

Closed
larspett opened this issue Oct 30, 2023 · 18 comments
Closed

abundance_year_compare does not save #23

larspett opened this issue Oct 30, 2023 · 18 comments
Assignees
Labels
bug Something isn't working platform:Windows Issue only concern Windows OS

Comments

@larspett
Copy link
Collaborator

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

@larspett larspett added the bug Something isn't working label Oct 30, 2023
@ScientiaFelis ScientiaFelis added this to the sebmsR Version 1.5.0 milestone Oct 30, 2023
@ScientiaFelis
Copy link
Owner

Cannot reproduce error!?

@larspett
Copy link
Collaborator Author

larspett commented Oct 30, 2023 via email

@ScientiaFelis ScientiaFelis added the platform:Windows Issue only concern Windows OS label Oct 31, 2023
@ScientiaFelis
Copy link
Owner

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)

@larspett
Copy link
Collaborator Author

larspett commented Oct 31, 2023 via email

@larspett
Copy link
Collaborator Author

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.

@larspett
Copy link
Collaborator Author

larspett commented Oct 31, 2023

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

@ScientiaFelis
Copy link
Owner

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

@larspett
Copy link
Collaborator Author

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

@ScientiaFelis
Copy link
Owner

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?

@larspett
Copy link
Collaborator Author

larspett commented Oct 31, 2023 via email

@ScientiaFelis
Copy link
Owner

Is this still failing @larspett ?

@larspett
Copy link
Collaborator Author

larspett commented Nov 1, 2023

No font error thrown bit does not save

@larspett larspett removed their assignment Nov 1, 2023
@larspett
Copy link
Collaborator Author

larspett commented Nov 1, 2023

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

@larspett
Copy link
Collaborator Author

larspett commented Nov 1, 2023

and the png is still 0 kB

@ScientiaFelis
Copy link
Owner

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

@larspett
Copy link
Collaborator Author

larspett commented Nov 2, 2023

Butterflynumber is still 0 kB in latest version (1.4.7)

@ScientiaFelis
Copy link
Owner

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

@ScientiaFelis
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform:Windows Issue only concern Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants