![]() ![]() ![]() ![]() Pandoc 2.18 /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown) We can use a logo with a lot of whitespace, to play around with. So here, we’ll need to convert some of our code, but it will still turn out pretty good! Again please note, that I’m using image_ggplot() just to show it in the blogpost, and interactively you can just return the output to the RStudio viewer. Another ImageMagick proper blogpost from Nate Murray was also very useful. Now, the logos present another problem, they have large whitespace areas INSIDE the logos themselves… so if you were to apply a global transparency they would end up transparent INSIDE the logos where they should be white.Īgain, for another fantastic longer form blogpost, make sure to check out Deemah’s blogpost on Miracles with magick! I looked through some of his examples, although I used a slightly different workflow here for the logos. We can see the capture group via str_match(), this will separate out the full match from the capture group. A capture group allows us to reference this portion later (with \\1).+ Quantifier - Matches between one and unlimited times, as many times as possible, giving back as needed (greedy).Match a single character not present in the list below +.This finds a literal / and with the previous code (./ matches the character / literally (case sensitive).Match a single character present in the list below.This basically finds everything up to the next portion.* Quantifier - Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy).* matches any character (except for line terminators) *(+).* gives us the following explanation at If you want to see some explanations for the regex, see the details tag below. Look pretty good, and the player headshots look fine as well. We can quickly convert this into gt table like so. ![]() $ team_name "Oilers", "Avalanche", "Avalanche", "Kings", "Canadien… $ full_name "CONNOR MCDAVID", "NATHAN MACKINNON", "MIKKO RANTANEN"… $ last_name "MCDAVID", "MACKINNON", "RANTANEN", "KOPITAR", "TOFFOL… $ first_name "CONNOR", "NATHAN", "MIKKO", "ANZE", "TYLER", "MITCHEL… $ num_last_first "97 MCDAVID, CONNOR", "29 MACKINNON, NATHAN", "96 RANT… $ player "CONNOR.MCDAVID", "NATHAN.MACKINNON", "MIKKO.RANTANEN"… We’ll load our libraries and pull in the data of interest, there are a lot of columns but I’ll limit it to a subset later on. I’ve gone ahead and rebuilt the examples with that in mind. He pointed out rightfully so, that simply replacing ALL white with transparent can have some negative effects (this REALLy is a problem with logos). In short, magick is an R wrapper around the ImageMagick library that is used for image processing.įor another fantastic longer form blogpost, make sure to check out Deemah’s blogpost on Miracles with magick! I adapted some of his examples for the logos at the end. If you missed my last blogpost, it has some more details on the package. He thought that magick could be used to remove the background, and let’s see what we can do! He had a bunch of player headshots for the NHL, but they had a white background which he wanted to remove and then embed the headshots in gt. Colin Welsh reached out on Twitter asking about removing the background from player headshots for use in dark-themed table. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |