## The aim of this session is to explore the Enter-sandman dataset,
## and train our RStudio skills.

## data needed: 1. the baroni vectorspace and 2. the Enter-sandman dataset

# Remember: explicit path or file.chose()
# Instead of read.csv() with the correct sep setting you can also use read.table()
enterSandman <- read.table("XLM-2018-0127_elp_data.txt",header=T)
load("baroni.rda")


# 1. Sanity checking: are the values in the dataset sound? Let's compare
# the head/mod compound similarities to values we calculate ourselves
# using the baroni vectorspace 

# 2. Sanity checking and a bit more: are the results presented in Table
# 1 A. correct and B. an unbiased selection?
# For a first comparison, we can check the top/bottom three of each
# category.
# [Hint: use order() and head/tail()]

# Why did the authors not decide to report these items (=the top/bottom three of each categories)?

# 3. Repeated modifiers and heads
# Recall the functions we used last week:
library(plyr)
count(enterSandman$head)

headFreqs <- count(enterSandman$head)
tail(headFreqs[order(headFreqs$freq),])

# Create a similar overview for the modifiers

# 3.1 How can we retrieve the value for "woman" from the headFreqs dataset? :)
# 
# 3.2 How many compounds have no repeating constituents at all? Do they
# maybe behave different from the overall dataset?
# Let's create a subset and check.
# 
# 3.3 Let's do the same for the items where both constituents are repeated.
    
# 4. What about the frequency distribution? Let's explore the compound
# frequency in some more detail
# A very straightforward approach for a first overview is the usage of
# a strip chart. The R-function is stripchart() (perhaps unexpectedly
# straightforward for R :))














