Hvad skal man vide om mig?

Hvis man skal arbejde sammen med mig. Et godt spørgsmål jeg fik forleden.

Man skal holde hvad man lover. Og hvis man ikke kan, så skal man sådan set bare sige til, for jeg er utroligt tilgivende. Men hvis du lover noget, og ikke fortæller at det desværre ikke kan lade sig gøre, så bliver jeg træt når det står klart at du ikke leverer.

Hvad ellers? Der hvor jeg virkelig bliver træt af folk er når de er inkonsistente. Eller hykleriske om man vil.

Du må godt være religionskritisk. Du må også godt være islamkritisk. Men hvis du påstår at du er religionskritisk, så bliver du dæleme nødt til faktisk at være det. Hvis du hævder at være religionskritisk, men pudsigt nok kun er kritisk overfor islam. Så bliver jeg lidt træt af dig.

Ret præcist lige så træt som jeg bliver hvis du hævder at være religionskritisk. Men tilfældigvis ikke overfor islam.

Hvis du synes det er urimeligt at man sætter etiketter på folk uden at have fået lov til det af dem. Så lad være med at sætte etiketter på mig uden at spørge. Du bryder dig ikke om at blive kaldt transseksuel. Det hedder transkønnet. Fint med mig, ingen problemer. Men hvis du bruger vigtigheden af ikke at sætte uønskede etiketter på folk som argument for det. Så lad være med at kalde mig cis-kønnet (uden at spørge om lov først).

Du må godt indføre burkaforbud. Men lad være med at påstå at du er liberal når du gør det.

Du må godt forbyde sombreroer til fester på Københavns Universitet fordi nogen bliver krænkede. Husk blot også at forbyde t-shirts med billeder af Che Guevara – du ved, ham der slog et signifikant tre-cifret antal mennesker ihjel under udbredelsen af en totalitær ideologi. Og satte homosexuelle i koncentrationslejre.

Misforstå mig ret. Jeg bliver også træt af folk der er islamkritiske. Jeg bliver bare mere træt af dem, hvis de – i modstrid med alt hvad de faktisk gør – hævder at de skam er religionskritiske.

Jeg synes jo i den grad at man skal være utroligt forsigtig med at sætte etiketter på folk. Men hvis du også synes det – så lad være med selv at gå rundt og etikettere folk.

Og jeg er heller ikke fan af burkaforbud (eller for den sags skyld burkaer). Men der burde være en paragraf i markedsføringsloven der ramte Danmarks “Liberale” Parti, når de indfører det.

Og du må for min skyld godt indføre forbud mod krænkende sombreroer. Men vær dog ærlig om at det handler om at du forbyder ting som et bestemt politisk segment ikke bryder sig om. For lur mig om netop Che Guevara t-shirts ikke vil blive ramt af forbud, skulle nogen føle sig krænket af dem.

Waffle charts

A rather popular chart type. Not really my favorite, but I can see how it makes things easier to understand for people who are not used to read and understand charts. The reason for my less than favourable view on waffle charts are probably linked to its overuse in meaningless infographics.

A waffle chart is a grid with squares/cells/icons/whatever, where each cell represents a number of something.

Lets make an example:

library(ggplot2)
library(waffle)
vec <- c(`Category 1 (10)`= 10 , `Category 2 (20)`= 20,
              `Category 3 (25)`= 24, `Category 4 (16)` = 16)

waffle(vec/2, rows=3, size=0.1, 
       colors=c("#c7d4b6", "#a3aabd", "#a0d0de", "#97b5cf"), 
       title="Four different categories of something", 
       xlab="1 square = 2 somethings")

plot of chunk unnamed-chunk-11
One annoyance: waffle wants you to spell colours wrong.

waffle takes a named vector of values, rows sets the number of rows of blocks. Default is 10.

One standard way, is to show a 10×10 grid, where each cell represents 1% of the total:

waffle(vec/sum(vec)*100)

plot of chunk unnamed-chunk-12

Bloody annoying – waffle rounds the values of the vector, leading to only 98 squares. So you have to manipulate your vector to get to 100. Well, actually it is probably a minor annoyance.

What if you want something else than coloured squares?

The arguments “use_glyph” and “glyph_size” makes that possible.
First, we’ll need the library extrafont

library(extrafont)

We’ll also need to have the “awesomefonts” installed. It can be downloaded from:

http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.ttf

This should be easier if you are on a desktop machine. As I’m running this through my own installation of RStudio on a remote server, it was a bit more difficult.

I needed to place the “fontawesome.ttf” file in the “/usr/share/fonts/truetype/fontawesome” directory.

Then, running R as superuser on the commandline, I imported the extrafont library, and then ran “font_import()”.

But then it worked!

There is now a long list of 593 different icons, that can be used. If you want a list, just run fa_list().

And now, we can make a waffle chart with the glyph of our choice.

waffle(vec/2, rows=4, use_glyph = "wifi")
## Warning: Removed 1 rows containing missing values (geom_text).

plot of chunk unnamed-chunk-14

We can change the colours:

library(RColorBrewer)
waffle(vec/2, rows=4, use_glyph = "wifi", colors=brewer.pal(6,"Set1"))
## Warning: Removed 1 rows containing missing values (geom_text).

plot of chunk unnamed-chunk-15

Adjust the size

waffle(vec/2, rows=4, use_glyph = "wifi", colors=brewer.pal(6,"Set1"), glyph_size=5)
## Font Awesome by Dave Gandy - http://fontawesome.io
## Warning: Removed 1 rows containing missing values (geom_text).

plot of chunk unnamed-chunk-16
But that does not look very good.

waffle is based on ggplot, so we have access to the full range of functionality. But not all of them are going to look good in this context:

waffle(vec/2, rows=4, use_glyph = "wifi", colors=brewer.pal(4,"Set1")) +
  geom_label(label="42", size = 3)
## Warning: Removed 1 rows containing missing values (geom_text).

plot of chunk unnamed-chunk-17

If we install a font that supports it, we even get access to the large number of UTF-8 glyphs. Here is a favorite of mine:

waffle(vec/2, rows=4, colors=brewer.pal(4,"Set1")) +
  geom_label(label=sprintf("\U1F427"), size = 8)

plot of chunk unnamed-chunk-18

Which of course requires you to have a font on your computer that supports penguins.

Here is one:
http://users.teilar.gr/~g1951d/Symbola.zip

Get the font colour from a cell in Excel

People do weird and wonderful things in Excel.

Other people then have to pull out the data from those spreadsheets.

“Other people”  tend to spend a lot of time crying into their coffee.

At the moment, I am trying to pull out data of a spreadsheet, where “something” can have a value of 1, 2 or 3. That is of course marked by an “x” in a cell. I need to convert that x to a number.

That is rather simple. What is not so simple, is that there can be two x’es. One, in black, to denote the current state of affairs. And a second x, in red, to denote what a future, state is wanted to be.

So – I need a way to get the color of an x. VBA can do that:

Function GetColour(ByVal Target As Range) As Single
Application.Volatile
GetColour = Target.Font.Color
End Function

And if I need a logical test:

Function IsBlack(ByVal Target As Range) As Boolean
Application.Volatile
If Target.Font.Color = 0 Then
IsBlack = True
Else
IsBlack = False
End If
End Function

 

My biggest weakness?

This probably sounds like humble bragging. But I have recently – again – reailized that my biggest weakness is that I take responsibility.

Hey! How is that a weakness?

Well… It becomes a weakness when you continually take responsibility for stuff that is really not your responsibilty. To the extent that you get stress, hypertension and ulcers. And to the extent that it impacts negatively on the things that actually are your responsibility.

And I have just done it again. The ad for a meeting in the local party is not very readable. That is not my responsibility. It belongs to the chairman. Not me. I should simply notify him that it is not very readable. And trust that he will do something about it. Instead I am thinking about remaking it myself. It would not be very difficult. But I do get stressed. If I have to redesign the ad, I wont have time to cook dinner tonight. And clean the house.

This is something that I really have to get better at handling. Otherwise I’ll be a very responsible person, doing great things for people and organizations around me. While burning out very fast.