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. Today we will work with the DUO dataset about the number of students per program in the past 5 years 2 which was used in lesson 2 of from-spps-to-r. [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 (https://blog.rmhogervorst.nl/2016/02/20/from-spss-to-r-part1.html#introduction “From spss to R, part 1”) Download a .sav (SPSS) file I downloaded the following dataset from DUO (Dienst uitvoering onderwijs): Aantal wo ingeschrevenen (binnen domein ho). 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]