If you believe some people, everything is getting worse1. More so in infosec. For the past few years I listened to many many hours of podcasts, many hours where spent on the weekly show Security Now!. The hosts Steven Gibson and Leo Laporte have been talking about security related news every week over 13 years. Although the content has changed over time, there used to be more explanations but the majority of time is now filled with news, we could use the sentiment in the episodes to see if ‘everything is getting worse’.
[Read More]
Turning kindle notes into a tidy data
It is my dream to do everything with R. And we aRe almost there. We can write blogs in blogdown or bookdown, write reports in RMarkdown (thank you Yihui Xie!) create interactive webpages with Shiny (thank you Winston Chang). Control our lifx lights with lifxr (great work Carl!) and use emoticons everywhere with the emo package.
There is even a novel of my vision! I recently found chapter 40 of A Dr.
[Read More]
Writing manuscripts in Rstudio, easy citations
Intro and setup This is a simple explanation of how to write a manuscript in RStudio. Writing a manuscript in RStudio is not ideal, but it has gotten better over time. It is now relatively easy to add citations to documents in RStudio.
**The goal is not think about formatting, and citations, but to write the manuscript and add citations on the fly with a nice visual help. **
[Read More]
Plotting a map with ggplot2, color by tile
Introduction Last week I was playing with creating maps using R and GGPLOT2. As I was learning I realized information about creating maps in ggplot is scattered over the internet. So here I combine all that knowledge. So if something is absolutely wrong/ ridiculous / stupid / slightly off or not clear, contact me or open an issue on the github page.
When you search for plotting examples you will often encounter the packages maps and mapdata.
[Read More]
From spss to R, part 4
This is the second part of working with ggplot. We will combine the packages dplyr and ggplot to improve our workflow. When you make a visualisation you often experiment with different versions of your plot. Our workflow will be dynamic, in stead of saving every version of the plot you created, we will recreate the plot untill it looks the way you want it.
In the previous lesson we worked with some build in datasets.
[Read More]
Creating a package for your data set
Turning your dataset into a package is very useful for reproducable research. This tutorial is for you, even if you’ve never created a package in r.
Why would you turn your dataset into a package?
very easy to share easy to load (library(name) is easier then load("path/to/file") or data<-read.csv("path/to/file") etc.) documentation is part of the package and will never separate from data attributes of file remain nice and easy introduction to package building What do you need to do to create a dataset package:
[Read More]
From spss to R, part 3
In this post we will start with a build-in dataset and some basic ggplot graphics. In the next post we will combine dplyr and ggplot to do awesome stuff with the Dutch University student counts from the previous lessons.
We will work with the build-in dataset mtcars.
There are many datasets in r library(help = "datasets") but in many examples online you will see the iris and mtcars examples. Find more information about the dataset with ?
[Read More]
Tidying your data
Introduction To make analyses work we often need to change the way files look. Sometimes information is recorded in a way that was very efficient for input but not workable for your analyses. In other words, the data is messy and we need to make it tidy.
Tidy data means 1:
Each variable forms a column. Each observation forms a row. Each type of observational unit forms a table.
[Read More]
From spss to R, part 2
Introduction In this lesson we will open a .sav file in Rstudio and manipulate the data.frame. We will select parts of the file and create some simple overviews. First time with R? No problem, see lesson 1
toc {:toc} Download a .sav (SPSS) file I downloaded the following dataset from DUO (Dienst uitvoering onderwijs): [Aantal wo ingeschrevenen (binnen domein ho)][3]. This dataset has a cc0 declaration, which means it is in the public domain and we can do anything we want with this file.
[Read More]
From spss to R, part 1
Introduction This whole blog is devoted to R and clean coding in R. But what if you want to start with R? There are millions of websites devoted to learning R. just look at the number of hits on a certain search machine. Most of these hits start with the basics and slowly work your way up to more advanced examples.
There is often one reason to start with R: you want to achieve something that doesn’t work in other programs.
[Read More]