I've just updated from PDFsharp 1.32 to 1.50, and I'm now getting the following error with one of the PDFs I create:
Method not found: 'PdfSharp.Pdf.PdfFontEmbedding PdfSharp.Drawing.XGraphics.get_MFEH()'.
The code in question seems to be when RenderDocument is called:
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(false, PdfSharp.Pdf.PdfFontEmbedding.Always);
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
Has anyone come across this? I'm not doing anything special other than adding a few sections and paragraphs to the document..
Maybe you did not replace all the assemblies that come with MigraDoc 1.50, maybe a reference is missing.
It seems MFEH was removed (H as in Hack). You have to use version 1.50 beta 3b of both PDFsharp and MigraDoc.
Try to provide an MCVE if the problem persists.
https://stackoverflow.com/help/mcve
Related
I'm tring tu use ggmice with ggplot2 but, when I try give me back this error.
I saw some explanations here but none solved my problem.
ggmice(m.out, ggplot2::aes(.imp, Pixel_Deforested)) +
geom_point()
Error: 'as_label' is not an exported object from 'namespace:ggplot2'
ggmice developer here! If the problem persists after updating R/ggplot2, please post an issue on Github, then I'll look into it! https://github.com/amices/ggmice/issues
I am trying to the 5th table (Shareholders) from the website but there was a parsing error.
Could anyone advice how to solve it?
My code:
=ImportHTML(“https://www.marketscreener.com/YANGZIJIANG-SHIPBUILDING-6499571/company/”, “table”, 5)
It seems there is something wrong with the quotation marks you used. Please try
=ImportHTML("https://www.marketscreener.com/YANGZIJIANG-SHIPBUILDING-6499571/company/", "table", 5)
and see if that helps?
Resolve parsing error by using ';'s instead of ','s
I am trying to plot a small rectangle of a map:
library(OpenStreetMap)
upper_left <- c(47.413, 8.551);
lower_right <- c(47.417, 8.556);
map_osm <- openmap(upper_left, lower_right, type = 'osm' );
plot(map_osm );
When I run that, the openmap function gives me the error Error in osmtile(x%%nX, y, zoom, type) : could not obtain tile: 540 298 10.
The documentation of OpenStreetMap seems to indicate that I need to add an API key. However, I am not sure how exactly I would do that (because I use type='osm', not type = url) and I am also unclear where I'd get such an API key from.
The java.lang.NullPointerException and the following R-error (Error in osmtile(...)) seem to come from an older version of OpenStreetMap.
By updating OpenStreetMap to the latest version (0.3.4 currently), the error disappears and the example code of OP should work as it is, without needing an API key.
The accepted answer is not adequate as the error can occur even with the most recent package version.
Sometimes if a particular area is not available in a specific style, you get an error similar to the one mentioned above independent of the package version. The solution would be to try the function with a different style. This is mentioned in the following blog post
As an example, the following modification may solve the issue:
library(OpenStreetMap)
upper_left <- c(47.413, 8.551);
lower_right <- c(47.417, 8.556);
map_osm <- openmap(upper_left, lower_right, type = 'opencyclemap');
plot(map_osm)
The exercise tutorial to the learnr package refers to the checkr packages:
The checkr package currently provides code checking functions that are compatible with learnr.
(Be aware that this reference does not point to the CRAN package checkr. Unfortunately, there is a duplicate package name.)
But in the learnr tutorial there is no advice how to use it together with checkr. On the other hand, the vignette in checkr is still a draft version, discusses advanced issues and is lacking an easy example in relation to learnr.
What I am looking for is a concrete procedure of a model example. For instance: How to check student input with the two-plus-twoexample, provided by the learnrR Markdown template "Interactive Tutorials".
So my question is: How to check with learnr the R code required to add two plus two using the checkr package?
Maybe this questions should use new tags (learnr and checkr) but I do not have the privileges to do so.
After many experiments the following procedure worked for me:
I have started a new project and loaded the R Markdown template
"Interactive Tutorial" and named it "01-Exercises". RStudio
generated a folder this name and put my "01-Exercises.Rmd" in this
folder.
I have added the line tutorial_options(exercise.checker =
checkr::check_for_learnr) to the setup chunk of my
"01-Exercises.Rmd" file.
I have added a new R chunk with the label two-and-two-check. (= The same name as the chunk name of the student task but added -check.)
In this R chunk I have added just one line check_two_and_two(USER_CODE) which will become my test function.
I have written a test function check_two_and_two in an extra script file "check_test.R" and saved under a folder "www".
I have sourced this script to the function into the memory. I ran rmarkdown::run("01-Exercises/01-Exercises.Rmd") from the console.
And here is my test function:
check_two_and_two <- function(USER_CODE) {
code <- for_checkr(USER_CODE)
t1 <- line_where(code, insist(all(F == "+"), "Your operator is {{F}}. This is not the assigned task."))
if (failed(t1)) return(t1)
t2 <- line_where(code, insist(all(V == 4), "Your solution is {{V}}. This is not the result (= 4) asked for."))
if (failed(t2)) return(t2)
line_binding(code, 2 + 2, failif(FALSE, "The pattern did not match."), message = "The result is correct, but I was looking for 2 + 2.")
}
Even if this worked for me: Maybe there is a better (more effective) solution?
I have been trying to get the Stan version of the old BUGS example "leuk" working, using the version from github.com/stan-dev/example-models. The version of leuk.stan there works fine, but gives warnings that "<-", "increment_log_prob", and "poisson_log" are all deprecated. I have edited all of the "<-" to "=", and "increment_log_prob" to "target +=", but I can't figure out what the correct replacement is for "poisson_log". I checked with Stan Reference 2.14.0 and found the suggestion on page 490 that the new equivalent to "poisson_log" was "poisson_log_lpmf" (with changing the "," to a "|"). This is syntactically correct and runs, but gives the wrong answer. Could someone tell me the correct replacement for "poisson_log"? Many thanks in advance.